Class: Io::Flow::V0::Models::AvailableFilterFormat
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AvailableFilterFormat
- 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 AvailableFilterFormat for this value, creating a new instance for an unknown value.
- .boolean ⇒ Object
-
.date ⇒ Object
Expects date in format YYYY-MM-DD.
- .decimal ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of AvailableFilterFormat for this value, or nil if not found.
- .money ⇒ Object
- .string ⇒ Object
- .unit_of_length ⇒ Object
- .unit_of_mass ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ AvailableFilterFormat
constructor
A new instance of AvailableFilterFormat.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AvailableFilterFormat
Returns a new instance of AvailableFilterFormat.
16005 16006 16007 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16005 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16003 16004 16005 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16003 def value @value end |
Class Method Details
.ALL ⇒ Object
16025 16026 16027 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16025 def AvailableFilterFormat.ALL @@all ||= [AvailableFilterFormat.boolean, AvailableFilterFormat.date, AvailableFilterFormat.money, AvailableFilterFormat.decimal, AvailableFilterFormat.string, AvailableFilterFormat.unit_of_length, AvailableFilterFormat.unit_of_mass] end |
.apply(value) ⇒ Object
Returns the instance of AvailableFilterFormat for this value, creating a new instance for an unknown value
16010 16011 16012 16013 16014 16015 16016 16017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16010 def AvailableFilterFormat.apply(value) if value.instance_of?(AvailableFilterFormat) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || AvailableFilterFormat.new(value)) end end |
.boolean ⇒ Object
16029 16030 16031 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16029 def AvailableFilterFormat.boolean @@_boolean ||= AvailableFilterFormat.new('boolean') end |
.date ⇒ Object
Expects date in format YYYY-MM-DD
16034 16035 16036 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16034 def AvailableFilterFormat.date @@_date ||= AvailableFilterFormat.new('date') end |
.decimal ⇒ Object
16042 16043 16044 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16042 def AvailableFilterFormat.decimal @@_decimal ||= AvailableFilterFormat.new('decimal') end |
.from_string(value) ⇒ Object
Returns the instance of AvailableFilterFormat for this value, or nil if not found
16020 16021 16022 16023 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16020 def AvailableFilterFormat.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvailableFilterFormat.ALL.find { |v| v.value == value } end |
.money ⇒ Object
16038 16039 16040 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16038 def AvailableFilterFormat.money @@_money ||= AvailableFilterFormat.new('money') end |
.string ⇒ Object
16046 16047 16048 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16046 def AvailableFilterFormat.string @@_string ||= AvailableFilterFormat.new('string') end |
.unit_of_length ⇒ Object
16050 16051 16052 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16050 def AvailableFilterFormat.unit_of_length @@_unit_of_length ||= AvailableFilterFormat.new('unit_of_length') end |
.unit_of_mass ⇒ Object
16054 16055 16056 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16054 def AvailableFilterFormat.unit_of_mass @@_unit_of_mass ||= AvailableFilterFormat.new('unit_of_mass') end |
Instance Method Details
#to_hash ⇒ Object
16058 16059 16060 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16058 def to_hash value end |