Class: Io::Flow::V0::Models::OrderQuoteSummaryShipping
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderQuoteSummaryShipping
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#freight ⇒ Object
readonly
Returns the value of attribute freight.
-
#surcharges ⇒ Object
readonly
Returns the value of attribute surcharges.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderQuoteSummaryShipping
constructor
A new instance of OrderQuoteSummaryShipping.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderQuoteSummaryShipping
Returns a new instance of OrderQuoteSummaryShipping.
53502 53503 53504 53505 53506 53507 53508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53502 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:total], 'OrderQuoteSummaryShipping') @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::OrderQuotePrice) ? x : ::Io::Flow::V0::Models::OrderQuotePrice.from_json(x)) @freight = (x = opts.delete(:freight); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderQuoteSummaryShippingFreight) ? x : ::Io::Flow::V0::Models::OrderQuoteSummaryShippingFreight.new(x))) @surcharges = (x = opts.delete(:surcharges); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderQuoteSummaryShippingSurcharges) ? x : ::Io::Flow::V0::Models::OrderQuoteSummaryShippingSurcharges.new(x))) end |
Instance Attribute Details
#freight ⇒ Object (readonly)
Returns the value of attribute freight.
53500 53501 53502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53500 def freight @freight end |
#surcharges ⇒ Object (readonly)
Returns the value of attribute surcharges.
53500 53501 53502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53500 def surcharges @surcharges end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
53500 53501 53502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53500 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
53514 53515 53516 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53514 def copy(incoming={}) OrderQuoteSummaryShipping.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
53518 53519 53520 53521 53522 53523 53524 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53518 def to_hash { :total => total.to_hash, :freight => freight.nil? ? nil : freight.to_hash, :surcharges => surcharges.nil? ? nil : surcharges.to_hash } end |
#to_json ⇒ Object
53510 53511 53512 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53510 def to_json JSON.dump(to_hash) end |