Class: Io::Flow::V0::Models::OrderReplacement
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderReplacement
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The order replacement details.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#parent_order ⇒ Object
readonly
Returns the value of attribute parent_order.
-
#replacement_order ⇒ Object
readonly
Returns the value of attribute replacement_order.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderReplacement
constructor
A new instance of OrderReplacement.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderReplacement
Returns a new instance of OrderReplacement.
53849 53850 53851 53852 53853 53854 53855 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53849 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :parent_order, :replacement_order], 'OrderReplacement') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @parent_order = (x = opts.delete(:parent_order); x.is_a?(::Io::Flow::V0::Models::Order) ? x : ::Io::Flow::V0::Models::Order.new(x)) @replacement_order = (x = opts.delete(:replacement_order); x.is_a?(::Io::Flow::V0::Models::Order) ? x : ::Io::Flow::V0::Models::Order.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
53847 53848 53849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53847 def id @id end |
#parent_order ⇒ Object (readonly)
Returns the value of attribute parent_order.
53847 53848 53849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53847 def parent_order @parent_order end |
#replacement_order ⇒ Object (readonly)
Returns the value of attribute replacement_order.
53847 53848 53849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53847 def replacement_order @replacement_order end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
53861 53862 53863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53861 def copy(incoming={}) OrderReplacement.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
53865 53866 53867 53868 53869 53870 53871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53865 def to_hash { :id => id, :parent_order => parent_order.to_hash, :replacement_order => replacement_order.to_hash } end |
#to_json ⇒ Object
53857 53858 53859 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53857 def to_json JSON.dump(to_hash) end |