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.
17232 17233 17234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17232 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17230 17231 17232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17230 def value @value end |
Class Method Details
.ALL ⇒ Object
17252 17253 17254 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17252 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
17237 17238 17239 17240 17241 17242 17243 17244 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17237 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
17256 17257 17258 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17256 def AvailableFilterFormat.boolean @@_boolean ||= AvailableFilterFormat.new('boolean') end |
.date ⇒ Object
Expects date in format YYYY-MM-DD
17261 17262 17263 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17261 def AvailableFilterFormat.date @@_date ||= AvailableFilterFormat.new('date') end |
.decimal ⇒ Object
17269 17270 17271 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17269 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
17247 17248 17249 17250 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17247 def AvailableFilterFormat.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvailableFilterFormat.ALL.find { |v| v.value == value } end |
.money ⇒ Object
17265 17266 17267 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17265 def AvailableFilterFormat.money @@_money ||= AvailableFilterFormat.new('money') end |
.string ⇒ Object
17273 17274 17275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17273 def AvailableFilterFormat.string @@_string ||= AvailableFilterFormat.new('string') end |
.unit_of_length ⇒ Object
17277 17278 17279 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17277 def AvailableFilterFormat.unit_of_length @@_unit_of_length ||= AvailableFilterFormat.new('unit_of_length') end |
.unit_of_mass ⇒ Object
17281 17282 17283 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17281 def AvailableFilterFormat.unit_of_mass @@_unit_of_mass ||= AvailableFilterFormat.new('unit_of_mass') end |
Instance Method Details
#to_hash ⇒ Object
17285 17286 17287 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17285 def to_hash value end |