class Io::Flow::V0::Models::CurrencySymbolFormat

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18308
def CurrencySymbolFormat.ALL
  @@all ||= [CurrencySymbolFormat.narrow, CurrencySymbolFormat.primary]
end
apply(value) click to toggle source

Returns the instance of CurrencySymbolFormat for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 18293
def CurrencySymbolFormat.apply(value)
  if value.instance_of?(CurrencySymbolFormat)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || CurrencySymbolFormat.new(value))
  end
end
from_string(value) click to toggle source

Returns the instance of CurrencySymbolFormat for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 18303
def CurrencySymbolFormat.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  CurrencySymbolFormat.ALL.find { |v| v.value == value }
end
narrow() click to toggle source

The narrow format refers to the Unicode Common Locale Data Repository (CLDR) ‘narrow’ symbols (e.g. ‘$’ for CAD and AUD)

# File lib/flow_commerce/flow_api_v0_client.rb, line 18314
def CurrencySymbolFormat.narrow
  @@_narrow ||= CurrencySymbolFormat.new('narrow')
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18288
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
primary() click to toggle source

The primary format refers to the Unicode Common Locale Data Repository (CLDR) ‘primary’ symbols (e.g. ‘CA$’ for CAD and ‘A$’ for AUD)

# File lib/flow_commerce/flow_api_v0_client.rb, line 18320
def CurrencySymbolFormat.primary
  @@_primary ||= CurrencySymbolFormat.new('primary')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18324
def to_hash
  value
end