Class: Io::Flow::V0::Models::SortDirection
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SortDirection
- 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 SortDirection for this value, creating a new instance for an unknown value.
- .ascending ⇒ Object
- .descending ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of SortDirection for this value, or nil if not found.
Instance Method Summary collapse
-
#initialize(value) ⇒ SortDirection
constructor
A new instance of SortDirection.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ SortDirection
Returns a new instance of SortDirection.
19354 19355 19356 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19354 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19352 19353 19354 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19352 def value @value end |
Class Method Details
.ALL ⇒ Object
19374 19375 19376 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19374 def SortDirection.ALL @@all ||= [SortDirection.ascending, SortDirection.descending] end |
.apply(value) ⇒ Object
Returns the instance of SortDirection for this value, creating a new instance for an unknown value
19359 19360 19361 19362 19363 19364 19365 19366 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19359 def SortDirection.apply(value) if value.instance_of?(SortDirection) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || SortDirection.new(value)) end end |
.ascending ⇒ Object
19378 19379 19380 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19378 def SortDirection.ascending @@_ascending ||= SortDirection.new('ascending') end |
.descending ⇒ Object
19382 19383 19384 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19382 def SortDirection.descending @@_descending ||= SortDirection.new('descending') end |
.from_string(value) ⇒ Object
Returns the instance of SortDirection for this value, or nil if not found
19369 19370 19371 19372 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19369 def SortDirection.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SortDirection.ALL.find { |v| v.value == value } end |
Instance Method Details
#to_hash ⇒ Object
19386 19387 19388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19386 def to_hash value end |