Class: Io::Flow::V0::Models::ShopifyLocalizationMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject (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

.ALLObject



26680
26681
26682
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26680

def ShopifyLocalizationMethod.ALL
  @@all ||= [ShopifyLocalizationMethod.api, ShopifyLocalizationMethod.ssr]
end

.apiObject

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

.ssrObject

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_hashObject



26695
26696
26697
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26695

def to_hash
  value
end