Class: Io::Flow::V0::Models::GoodsSupply
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::GoodsSupply
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of GoodsSupply for this value, creating a new instance for an unknown value.
-
.export ⇒ Object
Goods will be supplied from a DC from outside the national and customs boundaries of the destination.
-
.from_string(value) ⇒ Object
Returns the instance of GoodsSupply for this value, or nil if not found.
-
.intra_community ⇒ Object
Goods will be supplied from a DC outside the national boundries of the destination, but within the same customs union.
-
.local ⇒ Object
Goods will be supplied from a DC within the same country as the destination.
Instance Method Summary collapse
-
#initialize(value) ⇒ GoodsSupply
constructor
A new instance of GoodsSupply.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ GoodsSupply
Returns a new instance of GoodsSupply.
15813 15814 15815 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15813 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15811 15812 15813 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15811 def value @value end |
Class Method Details
.ALL ⇒ Object
15833 15834 15835 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15833 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
15818 15819 15820 15821 15822 15823 15824 15825 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15818 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 |
.export ⇒ Object
Goods will be supplied from a DC from outside the national and customs boundaries of the destination.
15839 15840 15841 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15839 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
15828 15829 15830 15831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15828 def GoodsSupply.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) GoodsSupply.ALL.find { |v| v.value == value } end |
.intra_community ⇒ Object
Goods will be supplied from a DC outside the national boundries of the destination, but within the same customs union.
15845 15846 15847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15845 def GoodsSupply.intra_community @@_intra_community ||= GoodsSupply.new('intra_community') end |
.local ⇒ Object
Goods will be supplied from a DC within the same country as the destination.
15850 15851 15852 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15850 def GoodsSupply.local @@_local ||= GoodsSupply.new('local') end |
Instance Method Details
#to_hash ⇒ Object
15854 15855 15856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15854 def to_hash value end |