Class: Io::Flow::V0::Models::OrderPlacedDetails
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderPlacedDetails
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Order is submitted, allocations are generated and the total value of the order is accounted for by discounts, subsidies, credits and authorized payments – but may not ready to fulfill (e.g. pending assignment of a DC or fraud review).
Instance Attribute Summary collapse
-
#allocation ⇒ Object
readonly
Returns the value of attribute allocation.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderPlacedDetails
constructor
A new instance of OrderPlacedDetails.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderPlacedDetails
Returns a new instance of OrderPlacedDetails.
41605 41606 41607 41608 41609 41610 41611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41605 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :order, :allocation], 'OrderPlacedDetails') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::Order) ? x : ::Io::Flow::V0::Models::Order.new(x)) @allocation = (x = opts.delete(:allocation); x.is_a?(::Io::Flow::V0::Models::AllocationV2) ? x : ::Io::Flow::V0::Models::AllocationV2.new(x)) end |
Instance Attribute Details
#allocation ⇒ Object (readonly)
Returns the value of attribute allocation.
41603 41604 41605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41603 def allocation @allocation end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
41603 41604 41605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41603 def id @id end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
41603 41604 41605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41603 def order @order end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def copy(incoming={}) OrderPlacedDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41621 41622 41623 41624 41625 41626 41627 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41621 def to_hash { :id => id, :order => order.to_hash, :allocation => allocation.to_hash } end |
#to_json ⇒ Object
41613 41614 41615 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41613 def to_json JSON.dump(to_hash) end |