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.
-
#inventory_status ⇒ Object
readonly
Returns the value of attribute inventory_status.
-
#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.
41619 41620 41621 41622 41623 41624 41625 41626 41627 41628 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41619 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)) @inventory_status = (x = opts.delete(:inventory_status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ItemAvailabilityStatus) ? x : ::Io::Flow::V0::Models::ItemAvailabilityStatus.apply(x))) end |
Instance Attribute Details
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def experience @experience end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def handle @handle end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def id @id end |
#inventory_status ⇒ Object (readonly)
Returns the value of attribute inventory_status.
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def inventory_status @inventory_status end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def prices @prices end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
41617 41618 41619 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41617 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41634 41635 41636 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41634 def copy(incoming={}) ShopifyLocalizedVariant.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41638 41639 41640 41641 41642 41643 41644 41645 41646 41647 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41638 def to_hash { :id => id, :handle => handle, :experience => experience.to_hash, :prices => prices.to_hash, :status => status.value, :inventory_status => inventory_status.nil? ? nil : inventory_status.value } end |
#to_json ⇒ Object
41630 41631 41632 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41630 def to_json JSON.dump(to_hash) end |