Class: Io::Flow::V0::Models::ChannelCurrencyCapability

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) ⇒ ChannelCurrencyCapability

Returns a new instance of ChannelCurrencyCapability.



17891
17892
17893
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17891

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17889
17890
17891
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17889

def value
  @value
end

Class Method Details

.ALLObject



17911
17912
17913
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17911

def ChannelCurrencyCapability.ALL
  @@all ||= [ChannelCurrencyCapability.payment_authorizations, ChannelCurrencyCapability.settlement_currency]
end

.apply(value) ⇒ Object

Returns the instance of ChannelCurrencyCapability for this value, creating a new instance for an unknown value



17896
17897
17898
17899
17900
17901
17902
17903
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17896

def ChannelCurrencyCapability.apply(value)
  if value.instance_of?(ChannelCurrencyCapability)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ChannelCurrencyCapability.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of ChannelCurrencyCapability for this value, or nil if not found



17906
17907
17908
17909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17906

def ChannelCurrencyCapability.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ChannelCurrencyCapability.ALL.find { |v| v.value == value }
end

.payment_authorizationsObject



17915
17916
17917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17915

def ChannelCurrencyCapability.payment_authorizations
  @@_payment_authorizations ||= ChannelCurrencyCapability.new('payment_authorizations')
end

.settlement_currencyObject



17919
17920
17921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17919

def ChannelCurrencyCapability.settlement_currency
  @@_settlement_currency ||= ChannelCurrencyCapability.new('settlement_currency')
end

Instance Method Details

#to_hashObject



17923
17924
17925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17923

def to_hash
  value
end