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.
22269 22270 22271 22272 22273 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22269 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.
22267 22268 22269 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22267 def attributes @attributes end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
22267 22268 22269 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22267 def lines @lines end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22279 22280 22281 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22279 def copy(incoming={}) OrderUpdateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22283 22284 22285 22286 22287 22288 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22283 def to_hash { :lines => lines.nil? ? nil : lines.map { |o| o.to_hash }, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
22275 22276 22277 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22275 def to_json JSON.dump(to_hash) end |