Class: Io::Flow::V0::Models::Direction

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

Returns a new instance of Direction.



14935
14936
14937
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14935

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14933
14934
14935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14933

def value
  @value
end

Class Method Details

.ALLObject



14955
14956
14957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14955

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

.apply(value) ⇒ Object

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



14940
14941
14942
14943
14944
14945
14946
14947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14940

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

.from_string(value) ⇒ Object

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



14950
14951
14952
14953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14950

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

.outboundObject

Outbound shipment to typically fulfill a customer order



14960
14961
14962
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14960

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

.returnObject

Inbound or return shipment



14965
14966
14967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14965

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

Instance Method Details

#to_hashObject



14969
14970
14971
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14969

def to_hash
  value
end