Class: Io::Flow::V0::Models::OrderReplacementForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderReplacementForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The order replacement form is used to create a replacement order.
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderReplacementForm
constructor
A new instance of OrderReplacementForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderReplacementForm
Returns a new instance of OrderReplacementForm.
53913 53914 53915 53916 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53913 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @items = (x = opts.delete(:items); x.nil? ? nil : HttpClient::Preconditions.assert_class('items', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) }) end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
53911 53912 53913 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53911 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
53922 53923 53924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53922 def copy(incoming={}) OrderReplacementForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
53926 53927 53928 53929 53930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53926 def to_hash { :items => items.nil? ? nil : items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
53918 53919 53920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53918 def to_json JSON.dump(to_hash) end |