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.



17165
17166
17167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17165

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17163
17164
17165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17163

def value
  @value
end

Class Method Details

.ALLObject



17185
17186
17187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17185

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



17170
17171
17172
17173
17174
17175
17176
17177
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17170

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



17180
17181
17182
17183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17180

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

.outboundObject



17189
17190
17191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17189

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

.returnObject



17193
17194
17195
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17193

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

Instance Method Details

#to_hashObject



17197
17198
17199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17197

def to_hash
  value
end