Class: Io::Flow::V0::Models::ShopifyCartChangeForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyCartChangeForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Must provide either line or id. If you provide both, they must match
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyCartChangeForm
constructor
A new instance of ShopifyCartChangeForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyCartChangeForm
Returns a new instance of ShopifyCartChangeForm.
48380 48381 48382 48383 48384 48385 48386 48387 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48380 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:quantity], 'ShopifyCartChangeForm') @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) @line = (x = opts.delete(:line); x.nil? ? nil : HttpClient::Preconditions.assert_class('line', x, Integer)) @id = (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Integer)) @properties = (x = opts.delete(:properties); x.nil? ? nil : HttpClient::Preconditions.assert_class('properties', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('properties', d[1], String); h }) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
48378 48379 48380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48378 def id @id end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
48378 48379 48380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48378 def line @line end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
48378 48379 48380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48378 def properties @properties end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
48378 48379 48380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48378 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48393 48394 48395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48393 def copy(incoming={}) ShopifyCartChangeForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
48397 48398 48399 48400 48401 48402 48403 48404 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48397 def to_hash { :quantity => quantity, :line => line, :id => id, :properties => properties.nil? ? nil : properties } end |
#to_json ⇒ Object
48389 48390 48391 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48389 def to_json JSON.dump(to_hash) end |