Class: Io::Flow::V0::Models::OrderUpdateForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrderUpdateForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderUpdateForm
constructor
A new instance of OrderUpdateForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrderUpdateForm
Returns a new instance of OrderUpdateForm.
22257 22258 22259 22260 22261 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22257 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @lines = (x = opts.delete(:lines); x.nil? ? nil : HttpClient::Preconditions.assert_class('lines', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderLineUpdateForm) ? x : ::Io::Flow::V0::Models::OrderLineUpdateForm.new(x)) }) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
22255 22256 22257 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22255 def attributes @attributes end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
22255 22256 22257 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22255 def lines @lines end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22267 22268 22269 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22267 def copy(incoming={}) OrderUpdateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22271 22272 22273 22274 22275 22276 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22271 def to_hash { :lines => lines.nil? ? nil : lines.map { |o| o.to_hash }, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
22263 22264 22265 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22263 def to_json JSON.dump(to_hash) end |