Class: Io::Flow::V0::Models::ShopifyCartAddMultipleForm
- Inherits:
-
ShopifyCartAddForm
- Object
- ShopifyCartAddForm
- Io::Flow::V0::Models::ShopifyCartAddMultipleForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Attributes inherited from ShopifyCartAddForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyCartAddMultipleForm
constructor
A new instance of ShopifyCartAddMultipleForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ShopifyCartAddForm
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyCartAddMultipleForm
Returns a new instance of ShopifyCartAddMultipleForm.
50490 50491 50492 50493 50494 50495 50496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50490 def initialize(incoming={}) super(:discriminator => ShopifyCartAddForm::Types::SHOPIFY_CART_ADD_MULTIPLE_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:items], 'ShopifyCartAddMultipleForm') @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShopifyCartAddSingleForm) ? x : ::Io::Flow::V0::Models::ShopifyCartAddSingleForm.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.
50488 50489 50490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50488 def attributes @attributes end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
50488 50489 50490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50488 def items @items end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50502 50503 50504 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50502 def copy(incoming={}) ShopifyCartAddMultipleForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
50506 50507 50508 50509 50510 50511 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50506 def subtype_to_hash { :items => items.map { |o| o.to_hash }, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
50498 50499 50500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50498 def to_json JSON.dump(to_hash) end |