Class: Io::Flow::V0::Models::RatecardSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ RatecardSummary

Returns a new instance of RatecardSummary.



55430
55431
55432
55433
55434
55435
55436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55430

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :number, :ratecard_owner], 'RatecardSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @ratecard_owner = (x = opts.delete(:ratecard_owner); x.is_a?(::Io::Flow::V0::Models::RatecardOwner) ? x : ::Io::Flow::V0::Models::RatecardOwner.apply(x))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



55428
55429
55430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55428

def id
  @id
end

#numberObject (readonly)

Returns the value of attribute number.



55428
55429
55430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55428

def number
  @number
end

#ratecard_ownerObject (readonly)

Returns the value of attribute ratecard_owner.



55428
55429
55430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55428

def ratecard_owner
  @ratecard_owner
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55442
55443
55444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55442

def copy(incoming={})
  RatecardSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



55446
55447
55448
55449
55450
55451
55452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55446

def to_hash
  {
    :id => id,
    :number => number,
    :ratecard_owner => ratecard_owner.value
  }
end

#to_jsonObject



55438
55439
55440
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55438

def to_json
  JSON.dump(to_hash)
end