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.



17426
17427
17428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17426

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17424
17425
17426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17424

def value
  @value
end

Class Method Details

.ALLObject



17446
17447
17448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17446

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



17431
17432
17433
17434
17435
17436
17437
17438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17431

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



17441
17442
17443
17444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17441

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

.outboundObject



17450
17451
17452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17450

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

.returnObject



17454
17455
17456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17454

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

Instance Method Details

#to_hashObject



17458
17459
17460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17458

def to_hash
  value
end