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.



21939
21940
21941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21939

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21937
21938
21939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21937

def value
  @value
end

Class Method Details

.ALLObject



21959
21960
21961
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21959

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



21944
21945
21946
21947
21948
21949
21950
21951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21944

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



21954
21955
21956
21957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21954

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

.outboundObject



21963
21964
21965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21963

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

.returnObject



21967
21968
21969
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21967

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

Instance Method Details

#to_hashObject



21971
21972
21973
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21971

def to_hash
  value
end