Class: Io::Flow::V0::Models::CurrencySymbolFormat
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CurrencySymbolFormat
- 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
-
.apply(value) ⇒ Object
Returns the instance of CurrencySymbolFormat for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of CurrencySymbolFormat for this value, or nil if not found.
-
.narrow ⇒ Object
The narrow format refers to the Unicode Common Locale Data Repository (CLDR) ‘narrow’ symbols (e.g. ‘$’ for CAD and AUD).
-
.primary ⇒ Object
The primary format refers to the Unicode Common Locale Data Repository (CLDR) ‘primary’ symbols (e.g. ‘CA$’ for CAD and ‘A$’ for AUD).
Instance Method Summary collapse
-
#initialize(value) ⇒ CurrencySymbolFormat
constructor
A new instance of CurrencySymbolFormat.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ CurrencySymbolFormat
Returns a new instance of CurrencySymbolFormat.
10573 10574 10575 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10573 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10571 10572 10573 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10571 def value @value end |
Class Method Details
.ALL ⇒ Object
10593 10594 10595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10593 def CurrencySymbolFormat.ALL @@all ||= [CurrencySymbolFormat.narrow, CurrencySymbolFormat.primary] end |
.apply(value) ⇒ Object
Returns the instance of CurrencySymbolFormat for this value, creating a new instance for an unknown value
10578 10579 10580 10581 10582 10583 10584 10585 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10578 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) ⇒ Object
Returns the instance of CurrencySymbolFormat for this value, or nil if not found
10588 10589 10590 10591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10588 def CurrencySymbolFormat.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) CurrencySymbolFormat.ALL.find { |v| v.value == value } end |
.narrow ⇒ Object
The narrow format refers to the Unicode Common Locale Data Repository (CLDR) ‘narrow’ symbols (e.g. ‘$’ for CAD and AUD)
10599 10600 10601 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10599 def CurrencySymbolFormat.narrow @@_narrow ||= CurrencySymbolFormat.new('narrow') end |
.primary ⇒ Object
The primary format refers to the Unicode Common Locale Data Repository (CLDR) ‘primary’ symbols (e.g. ‘CA$’ for CAD and ‘A$’ for AUD)
10605 10606 10607 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10605 def CurrencySymbolFormat.primary @@_primary ||= CurrencySymbolFormat.new('primary') end |
Instance Method Details
#to_hash ⇒ Object
10609 10610 10611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10609 def to_hash value end |