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.
49976 49977 49978 49979 49980 49981 49982 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49976 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.
49974 49975 49976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49974 def id @id end |
#parent_order ⇒ Object (readonly)
Returns the value of attribute parent_order.
49974 49975 49976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49974 def parent_order @parent_order end |
#replacement_order ⇒ Object (readonly)
Returns the value of attribute replacement_order.
49974 49975 49976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49974 def replacement_order @replacement_order end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
49988 49989 49990 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49988 def copy(incoming={}) OrderReplacement.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
49992 49993 49994 49995 49996 49997 49998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49992 def to_hash { :id => id, :parent_order => parent_order.to_hash, :replacement_order => replacement_order.to_hash } end |
#to_json ⇒ Object
49984 49985 49986 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49984 def to_json JSON.dump(to_hash) end |