Class: Io::Flow::V0::Models::ShopifyCartAddSingleForm
- Inherits:
-
ShopifyCartAddForm
- Object
- ShopifyCartAddForm
- Io::Flow::V0::Models::ShopifyCartAddSingleForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Attributes inherited from ShopifyCartAddForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyCartAddSingleForm
constructor
A new instance of ShopifyCartAddSingleForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ShopifyCartAddForm
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyCartAddSingleForm
Returns a new instance of ShopifyCartAddSingleForm.
38082 38083 38084 38085 38086 38087 38088 38089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38082 def initialize(incoming={}) super(:discriminator => ShopifyCartAddForm::Types::SHOPIFY_CART_ADD_SINGLE_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :quantity], 'ShopifyCartAddSingleForm') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), Integer) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), 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.
38080 38081 38082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38080 def id @id end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
38080 38081 38082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38080 def properties @properties end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
38080 38081 38082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38080 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38095 38096 38097 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38095 def copy(incoming={}) ShopifyCartAddSingleForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
38099 38100 38101 38102 38103 38104 38105 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38099 def subtype_to_hash { :id => id, :quantity => quantity, :properties => properties.nil? ? nil : properties } end |
#to_json ⇒ Object
38091 38092 38093 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38091 def to_json JSON.dump(to_hash) end |