Class: Io::Flow::V0::Models::ShippingLabelLaneSummary

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

Returns a new instance of ShippingLabelLaneSummary.



61681
61682
61683
61684
61685
61686
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61681

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



61679
61680
61681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61679

def id
  @id
end

#ratecardObject (readonly)

Returns the value of attribute ratecard.



61679
61680
61681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61679

def ratecard
  @ratecard
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



61692
61693
61694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61692

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

#to_hashObject



61696
61697
61698
61699
61700
61701
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61696

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

#to_jsonObject



61688
61689
61690
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61688

def to_json
  JSON.dump(to_hash)
end