Class: Io::Flow::V0::Models::FeeDeductionType

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#valueObject (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

.ALLObject



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

.fxObject



19048
19049
19050
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19048

def FeeDeductionType.fx
  @@_fx ||= FeeDeductionType.new('fx')
end

.morObject



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_hashObject



19052
19053
19054
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19052

def to_hash
  value
end