Class: Io::Flow::V0::Models::TierDirection
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TierDirection
- 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 TierDirection for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of TierDirection for this value, or nil if not found.
- .outbound ⇒ Object
- .return ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ TierDirection
constructor
A new instance of TierDirection.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TierDirection
Returns a new instance of TierDirection.
10843 10844 10845 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10843 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10841 10842 10843 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10841 def value @value end |
Class Method Details
.ALL ⇒ Object
10863 10864 10865 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10863 def TierDirection.ALL @@all ||= [TierDirection.outbound, TierDirection.return] end |
.apply(value) ⇒ Object
Returns the instance of TierDirection for this value, creating a new instance for an unknown value
10848 10849 10850 10851 10852 10853 10854 10855 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10848 def TierDirection.apply(value) if value.instance_of?(TierDirection) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TierDirection.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of TierDirection for this value, or nil if not found
10858 10859 10860 10861 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10858 def TierDirection.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TierDirection.ALL.find { |v| v.value == value } end |
.outbound ⇒ Object
10867 10868 10869 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10867 def TierDirection.outbound @@_outbound ||= TierDirection.new('outbound') end |
.return ⇒ Object
10871 10872 10873 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10871 def TierDirection.return @@_return ||= TierDirection.new('return') end |
Instance Method Details
#to_hash ⇒ Object
10875 10876 10877 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10875 def to_hash value end |