Class: Io::Flow::V0::Models::LaneDirection

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

Returns a new instance of LaneDirection.



17608
17609
17610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17608

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17606
17607
17608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17606

def value
  @value
end

Class Method Details

.ALLObject



17628
17629
17630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17628

def LaneDirection.ALL
  @@all ||= [LaneDirection.outbound, LaneDirection.return]
end

.apply(value) ⇒ Object

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



17613
17614
17615
17616
17617
17618
17619
17620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17613

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

.from_string(value) ⇒ Object

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



17623
17624
17625
17626
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17623

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

.outboundObject



17632
17633
17634
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17632

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

.returnObject



17636
17637
17638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17636

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

Instance Method Details

#to_hashObject



17640
17641
17642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17640

def to_hash
  value
end