Class: Io::Flow::V0::Models::ShippingLabelHopSummary
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShippingLabelHopSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#lane ⇒ Object
readonly
Returns the value of attribute lane.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingLabelHopSummary
constructor
A new instance of ShippingLabelHopSummary.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShippingLabelHopSummary
Returns a new instance of ShippingLabelHopSummary.
66529 66530 66531 66532 66533 66534 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66529 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:lane, :cost], 'ShippingLabelHopSummary') @lane = (x = opts.delete(:lane); x.is_a?(::Io::Flow::V0::Models::ShippingLabelLaneSummary) ? x : ::Io::Flow::V0::Models::ShippingLabelLaneSummary.new(x)) @cost = (x = opts.delete(:cost); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) end |
Instance Attribute Details
#cost ⇒ Object (readonly)
Returns the value of attribute cost.
66527 66528 66529 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66527 def cost @cost end |
#lane ⇒ Object (readonly)
Returns the value of attribute lane.
66527 66528 66529 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66527 def lane @lane end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
66540 66541 66542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66540 def copy(incoming={}) ShippingLabelHopSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
66544 66545 66546 66547 66548 66549 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66544 def to_hash { :lane => lane.to_hash, :cost => cost.to_hash } end |
#to_json ⇒ Object
66536 66537 66538 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66536 def to_json JSON.dump(to_hash) end |