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.
47876 47877 47878 47879 47880 47881 47882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47876 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.
47874 47875 47876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47874 def id @id end |
#parent_order ⇒ Object (readonly)
Returns the value of attribute parent_order.
47874 47875 47876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47874 def parent_order @parent_order end |
#replacement_order ⇒ Object (readonly)
Returns the value of attribute replacement_order.
47874 47875 47876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47874 def replacement_order @replacement_order end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47888 47889 47890 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47888 def copy(incoming={}) OrderReplacement.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
47892 47893 47894 47895 47896 47897 47898 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47892 def to_hash { :id => id, :parent_order => parent_order.to_hash, :replacement_order => replacement_order.to_hash } end |
#to_json ⇒ Object
47884 47885 47886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47884 def to_json JSON.dump(to_hash) end |