Class: Io::Flow::V0::Models::TierDirection

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

Returns a new instance of TierDirection.



15987
15988
15989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15987

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15985
15986
15987
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15985

def value
  @value
end

Class Method Details

.ALLObject



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

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



15992
15993
15994
15995
15996
15997
15998
15999
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15992

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



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

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

.outboundObject



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

def TierDirection.outbound
  @@_outbound ||= TierDirection.new('outbound')
end

.returnObject



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

def TierDirection.return
  @@_return ||= TierDirection.new('return')
end

Instance Method Details

#to_hashObject



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

def to_hash
  value
end