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.
50040 50041 50042 50043 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50040 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.
50038 50039 50040 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50038 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50049 50050 50051 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50049 def copy(incoming={}) OrderReplacementForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
50053 50054 50055 50056 50057 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50053 def to_hash { :items => items.nil? ? nil : items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
50045 50046 50047 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50045 def to_json JSON.dump(to_hash) end |