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.



66557
66558
66559
66560
66561
66562
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66557

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:ratecard], 'ShippingLabelLaneSummary')
  @id = (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, 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.



66555
66556
66557
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66555

def id
  @id
end

#ratecardObject (readonly)

Returns the value of attribute ratecard.



66555
66556
66557
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66555

def ratecard
  @ratecard
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



66568
66569
66570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66568

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

#to_hashObject



66572
66573
66574
66575
66576
66577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66572

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

#to_jsonObject



66564
66565
66566
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66564

def to_json
  JSON.dump(to_hash)
end