Class: Io::Flow::V0::Models::DeliveredDuty
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DeliveredDuty
- 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 DeliveredDuty for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of DeliveredDuty for this value, or nil if not found.
-
.paid ⇒ Object
Delivered Duty Paid (DDP).
-
.unpaid ⇒ Object
Delivered Duty Unpaid (DDU).
Instance Method Summary collapse
-
#initialize(value) ⇒ DeliveredDuty
constructor
A new instance of DeliveredDuty.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ DeliveredDuty
Returns a new instance of DeliveredDuty.
9028 9029 9030 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9028 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9026 9027 9028 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9026 def value @value end |
Class Method Details
.ALL ⇒ Object
9048 9049 9050 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9048 def DeliveredDuty.ALL @@all ||= [DeliveredDuty.paid, DeliveredDuty.unpaid] end |
.apply(value) ⇒ Object
Returns the instance of DeliveredDuty for this value, creating a new instance for an unknown value
9033 9034 9035 9036 9037 9038 9039 9040 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9033 def DeliveredDuty.apply(value) if value.instance_of?(DeliveredDuty) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || DeliveredDuty.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of DeliveredDuty for this value, or nil if not found
9043 9044 9045 9046 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9043 def DeliveredDuty.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DeliveredDuty.ALL.find { |v| v.value == value } end |
.paid ⇒ Object
Delivered Duty Paid (DDP). See en.wikipedia.org/wiki/Incoterms for more information
9054 9055 9056 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9054 def DeliveredDuty.paid @@_paid ||= DeliveredDuty.new('paid') end |
.unpaid ⇒ Object
Delivered Duty Unpaid (DDU). See en.wikipedia.org/wiki/Incoterms for more information
9060 9061 9062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9060 def DeliveredDuty.unpaid @@_unpaid ||= DeliveredDuty.new('unpaid') end |
Instance Method Details
#to_hash ⇒ Object
9064 9065 9066 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9064 def to_hash value end |