Class: Io::Flow::V0::Models::FeeDeductionType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FeeDeductionType
- 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 FeeDeductionType for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of FeeDeductionType for this value, or nil if not found.
- .fx ⇒ Object
- .mor ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ FeeDeductionType
constructor
A new instance of FeeDeductionType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ FeeDeductionType
Returns a new instance of FeeDeductionType.
19020 19021 19022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19020 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
19018 19019 19020 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19018 def value @value end |
Class Method Details
.ALL ⇒ Object
19040 19041 19042 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19040 def FeeDeductionType.ALL @@all ||= [FeeDeductionType.mor, FeeDeductionType.fx] end |
.apply(value) ⇒ Object
Returns the instance of FeeDeductionType for this value, creating a new instance for an unknown value
19025 19026 19027 19028 19029 19030 19031 19032 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19025 def FeeDeductionType.apply(value) if value.instance_of?(FeeDeductionType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || FeeDeductionType.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of FeeDeductionType for this value, or nil if not found
19035 19036 19037 19038 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19035 def FeeDeductionType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) FeeDeductionType.ALL.find { |v| v.value == value } end |
.fx ⇒ Object
19048 19049 19050 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19048 def FeeDeductionType.fx @@_fx ||= FeeDeductionType.new('fx') end |
.mor ⇒ Object
19044 19045 19046 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19044 def FeeDeductionType.mor @@_mor ||= FeeDeductionType.new('mor') end |
Instance Method Details
#to_hash ⇒ Object
19052 19053 19054 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19052 def to_hash value end |