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.



19523
19524
19525
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19523

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19521
19522
19523
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19521

def value
  @value
end

Class Method Details

.ALLObject



19543
19544
19545
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19543

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



19528
19529
19530
19531
19532
19533
19534
19535
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19528

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



19538
19539
19540
19541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19538

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

.outboundObject



19547
19548
19549
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19547

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

.returnObject



19551
19552
19553
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19551

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

Instance Method Details

#to_hashObject



19555
19556
19557
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19555

def to_hash
  value
end