Class: Io::Flow::V0::Models::IncludedLevyKey

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

Returns a new instance of IncludedLevyKey.



15978
15979
15980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15978

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15976
15977
15978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15976

def value
  @value
end

Class Method Details

.ALLObject



15998
15999
16000
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15998

def IncludedLevyKey.ALL
  @@all ||= [IncludedLevyKey.duty, IncludedLevyKey.vat, IncludedLevyKey.vat_and_duty, IncludedLevyKey.none]
end

.apply(value) ⇒ Object

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



15983
15984
15985
15986
15987
15988
15989
15990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15983

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

.dutyObject



16002
16003
16004
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16002

def IncludedLevyKey.duty
  @@_duty ||= IncludedLevyKey.new('duty')
end

.from_string(value) ⇒ Object

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



15993
15994
15995
15996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15993

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

.noneObject



16014
16015
16016
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16014

def IncludedLevyKey.none
  @@_none ||= IncludedLevyKey.new('none')
end

.vatObject



16006
16007
16008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16006

def IncludedLevyKey.vat
  @@_vat ||= IncludedLevyKey.new('vat')
end

.vat_and_dutyObject



16010
16011
16012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16010

def IncludedLevyKey.vat_and_duty
  @@_vat_and_duty ||= IncludedLevyKey.new('vat_and_duty')
end

Instance Method Details

#to_hashObject



16018
16019
16020
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16018

def to_hash
  value
end