Class: Io::Flow::V0::Models::ShopifyLocalizedVariant
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyLocalizedVariant
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#experience ⇒ Object
readonly
Returns the value of attribute experience.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyLocalizedVariant
constructor
A new instance of ShopifyLocalizedVariant.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyLocalizedVariant
Returns a new instance of ShopifyLocalizedVariant.
37234 37235 37236 37237 37238 37239 37240 37241 37242 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37234 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :handle, :experience, :prices, :status], 'ShopifyLocalizedVariant') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), Integer) @handle = HttpClient::Preconditions.assert_class('handle', opts.delete(:handle), String) @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.new(x)) @prices = (x = opts.delete(:prices); x.is_a?(::Io::Flow::V0::Models::ShopifyLocalizedVariantPrices) ? x : ::Io::Flow::V0::Models::ShopifyLocalizedVariantPrices.new(x)) @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::SubcatalogItemStatus) ? x : ::Io::Flow::V0::Models::SubcatalogItemStatus.apply(x)) end |
Instance Attribute Details
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
37232 37233 37234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37232 def experience @experience end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
37232 37233 37234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37232 def handle @handle end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
37232 37233 37234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37232 def id @id end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
37232 37233 37234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37232 def prices @prices end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
37232 37233 37234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37232 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
37248 37249 37250 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37248 def copy(incoming={}) ShopifyLocalizedVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
37252 37253 37254 37255 37256 37257 37258 37259 37260 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37252 def to_hash { :id => id, :handle => handle, :experience => experience.to_hash, :prices => prices.to_hash, :status => status.value } end |
#to_json ⇒ Object
37244 37245 37246 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37244 def to_json JSON.dump(to_hash) end |