Class: Io::Flow::V0::Models::GoodsSupply

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

Returns a new instance of GoodsSupply.



16809
16810
16811
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16809

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16807
16808
16809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16807

def value
  @value
end

Class Method Details

.ALLObject



16829
16830
16831
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16829

def GoodsSupply.ALL
  @@all ||= [GoodsSupply.export, GoodsSupply.intra_community, GoodsSupply.local]
end

.apply(value) ⇒ Object

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



16814
16815
16816
16817
16818
16819
16820
16821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16814

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

.exportObject

Goods will be supplied from a DC from outside the national and customs boundaries of the destination.



16835
16836
16837
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16835

def GoodsSupply.export
  @@_export ||= GoodsSupply.new('export')
end

.from_string(value) ⇒ Object

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



16824
16825
16826
16827
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16824

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

.intra_communityObject

Goods will be supplied from a DC outside the national boundries of the destination, but within the same customs union.



16841
16842
16843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16841

def GoodsSupply.intra_community
  @@_intra_community ||= GoodsSupply.new('intra_community')
end

.localObject

Goods will be supplied from a DC within the same country as the destination.



16846
16847
16848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16846

def GoodsSupply.local
  @@_local ||= GoodsSupply.new('local')
end

Instance Method Details

#to_hashObject



16850
16851
16852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16850

def to_hash
  value
end