Class: Io::Flow::V0::Models::LaneSummary

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 = {}) ⇒ LaneSummary

Returns a new instance of LaneSummary.



48367
48368
48369
48370
48371
48372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48367

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



48365
48366
48367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48365

def id
  @id
end

#ratecardObject (readonly)

Returns the value of attribute ratecard.



48365
48366
48367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48365

def ratecard
  @ratecard
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



48378
48379
48380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48378

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

#to_hashObject



48382
48383
48384
48385
48386
48387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48382

def to_hash
  {
    :id => id,
    :ratecard => ratecard.to_hash
  }
end

#to_jsonObject



48374
48375
48376
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48374

def to_json
  JSON.dump(to_hash)
end