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.



42936
42937
42938
42939
42940
42941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42936

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.



42934
42935
42936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42934

def id
  @id
end

#ratecardObject (readonly)

Returns the value of attribute ratecard.



42934
42935
42936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42934

def ratecard
  @ratecard
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



42947
42948
42949
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42947

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

#to_hashObject



42951
42952
42953
42954
42955
42956
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42951

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

#to_jsonObject



42943
42944
42945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42943

def to_json
  JSON.dump(to_hash)
end