Class: Io::Flow::V0::Models::ShopifyVariantFlowMetafield
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyVariantFlowMetafield
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The shopify variant metafield defines the individual metafield values we write into Shopify for each variant. This model was introduced to enable server side rendering of content (e.g. the price on the product detail page). Each field in this model is available as its own metafield within a namespace named ‘price_abc’ where abc is a unique, short identifier for an experience.
Instance Attribute Summary collapse
-
#inventory_status ⇒ Object
readonly
Returns the value of attribute inventory_status.
-
#prices_compare_at ⇒ Object
readonly
Returns the value of attribute prices_compare_at.
-
#prices_currency ⇒ Object
readonly
Returns the value of attribute prices_currency.
-
#prices_duty ⇒ Object
readonly
Returns the value of attribute prices_duty.
-
#prices_includes ⇒ Object
readonly
Returns the value of attribute prices_includes.
-
#prices_item ⇒ Object
readonly
Returns the value of attribute prices_item.
-
#prices_status ⇒ Object
readonly
Returns the value of attribute prices_status.
-
#prices_vat ⇒ Object
readonly
Returns the value of attribute prices_vat.
-
#prices_vat_name ⇒ Object
readonly
Returns the value of attribute prices_vat_name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyVariantFlowMetafield
constructor
A new instance of ShopifyVariantFlowMetafield.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyVariantFlowMetafield
Returns a new instance of ShopifyVariantFlowMetafield.
52286 52287 52288 52289 52290 52291 52292 52293 52294 52295 52296 52297 52298 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52286 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:prices_item, :prices_currency, :prices_status], 'ShopifyVariantFlowMetafield') @prices_item = HttpClient::Preconditions.assert_class('prices_item', opts.delete(:prices_item), String) @prices_currency = HttpClient::Preconditions.assert_class('prices_currency', opts.delete(:prices_currency), String) @prices_includes = (x = opts.delete(:prices_includes); x.nil? ? nil : HttpClient::Preconditions.assert_class('prices_includes', x, String)) @prices_vat = (x = opts.delete(:prices_vat); x.nil? ? nil : HttpClient::Preconditions.assert_class('prices_vat', x, String)) @prices_vat_name = (x = opts.delete(:prices_vat_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('prices_vat_name', x, String)) @prices_duty = (x = opts.delete(:prices_duty); x.nil? ? nil : HttpClient::Preconditions.assert_class('prices_duty', x, String)) @prices_compare_at = (x = opts.delete(:prices_compare_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('prices_compare_at', x, String)) @prices_status = (x = opts.delete(:prices_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
#inventory_status ⇒ Object (readonly)
Returns the value of attribute inventory_status.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def inventory_status @inventory_status end |
#prices_compare_at ⇒ Object (readonly)
Returns the value of attribute prices_compare_at.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_compare_at @prices_compare_at end |
#prices_currency ⇒ Object (readonly)
Returns the value of attribute prices_currency.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_currency @prices_currency end |
#prices_duty ⇒ Object (readonly)
Returns the value of attribute prices_duty.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_duty @prices_duty end |
#prices_includes ⇒ Object (readonly)
Returns the value of attribute prices_includes.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_includes @prices_includes end |
#prices_item ⇒ Object (readonly)
Returns the value of attribute prices_item.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_item @prices_item end |
#prices_status ⇒ Object (readonly)
Returns the value of attribute prices_status.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_status @prices_status end |
#prices_vat ⇒ Object (readonly)
Returns the value of attribute prices_vat.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_vat @prices_vat end |
#prices_vat_name ⇒ Object (readonly)
Returns the value of attribute prices_vat_name.
52284 52285 52286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52284 def prices_vat_name @prices_vat_name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52304 52305 52306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52304 def copy(incoming={}) ShopifyVariantFlowMetafield.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52308 52309 52310 52311 52312 52313 52314 52315 52316 52317 52318 52319 52320 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52308 def to_hash { :prices_item => prices_item, :prices_currency => prices_currency, :prices_includes => prices_includes, :prices_vat => prices_vat, :prices_vat_name => prices_vat_name, :prices_duty => prices_duty, :prices_compare_at => prices_compare_at, :prices_status => prices_status.value, :inventory_status => inventory_status.nil? ? nil : inventory_status.value } end |
#to_json ⇒ Object
52300 52301 52302 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52300 def to_json JSON.dump(to_hash) end |