Class: Io::Flow::V0::Models::ShopifyLocalizationMethod
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyLocalizationMethod
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.api ⇒ Object
Indicates localization should be achieved via the API.
-
.apply(value) ⇒ Object
Returns the instance of ShopifyLocalizationMethod for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of ShopifyLocalizationMethod for this value, or nil if not found.
-
.ssr ⇒ Object
Indicates localization should be achieved via server side rendering.
Instance Method Summary collapse
-
#initialize(value) ⇒ ShopifyLocalizationMethod
constructor
A new instance of ShopifyLocalizationMethod.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ ShopifyLocalizationMethod
Returns a new instance of ShopifyLocalizationMethod.
26660 26661 26662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26660 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
26658 26659 26660 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26658 def value @value end |
Class Method Details
.ALL ⇒ Object
26680 26681 26682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26680 def ShopifyLocalizationMethod.ALL @@all ||= [ShopifyLocalizationMethod.api, ShopifyLocalizationMethod.ssr] end |
.api ⇒ Object
Indicates localization should be achieved via the API.
26685 26686 26687 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26685 def ShopifyLocalizationMethod.api @@_api ||= ShopifyLocalizationMethod.new('api') end |
.apply(value) ⇒ Object
Returns the instance of ShopifyLocalizationMethod for this value, creating a new instance for an unknown value
26665 26666 26667 26668 26669 26670 26671 26672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26665 def ShopifyLocalizationMethod.apply(value) if value.instance_of?(ShopifyLocalizationMethod) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || ShopifyLocalizationMethod.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of ShopifyLocalizationMethod for this value, or nil if not found
26675 26676 26677 26678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26675 def ShopifyLocalizationMethod.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) ShopifyLocalizationMethod.ALL.find { |v| v.value == value } end |
.ssr ⇒ Object
Indicates localization should be achieved via server side rendering. For example, using variant metafields.
26691 26692 26693 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26691 def ShopifyLocalizationMethod.ssr @@_ssr ||= ShopifyLocalizationMethod.new('ssr') end |
Instance Method Details
#to_hash ⇒ Object
26695 26696 26697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26695 def to_hash value end |