class OrangeData::PayloadContent

base class for semi-generated classes

Public Class Methods

new(payload={}) click to toggle source
# File lib/orange_data/generated_attributes.rb, line 111
def initialize(payload={})
  @payload = payload
end

Public Instance Methods

==(other) click to toggle source
# File lib/orange_data/generated_attributes.rb, line 128
def ==(other)
  self.class == other.class && to_hash == other.to_hash
  # @payload == other.instance_variable_get(:@payload)
end
as_json() click to toggle source
# File lib/orange_data/generated_attributes.rb, line 137
def as_json
  to_hash
end
assign_attributes(options) click to toggle source
# File lib/orange_data/generated_attributes.rb, line 115
def assign_attributes(options)
  options.each_pair{|k, v|
    setter = :"#{k}="
    send(setter, v)
  }
  # for chaining:
  self
end
attributes() click to toggle source
# File lib/orange_data/generated_attributes.rb, line 124
def attributes
  to_hash.map{|(k, v)| [k.underscore, v] }.to_h
end
to_hash() click to toggle source
# File lib/orange_data/generated_attributes.rb, line 133
def to_hash
  @payload
end
to_json(*args) click to toggle source
# File lib/orange_data/generated_attributes.rb, line 141
def to_json(*args)
  as_json.to_json(*args)
end