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



16535
16536
16537
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16535

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16533
16534
16535
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16533

def value
  @value
end

Class Method Details

.ALLObject



16555
16556
16557
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16555

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



16540
16541
16542
16543
16544
16545
16546
16547
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16540

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



16550
16551
16552
16553
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16550

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

.outboundObject



16559
16560
16561
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16559

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

.returnObject



16563
16564
16565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16563

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

Instance Method Details

#to_hashObject



16567
16568
16569
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16567

def to_hash
  value
end