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.
13552 13553 13554 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13552 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
13550 13551 13552 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13550 def value @value end |
Class Method Details
.ALL ⇒ Object
13572 13573 13574 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13572 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
13557 13558 13559 13560 13561 13562 13563 13564 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13557 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
13567 13568 13569 13570 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13567 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 https://en.wikipedia.org/wiki/Incoterms for more information
13578 13579 13580 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13578 def DeliveredDuty.paid @@_paid ||= DeliveredDuty.new('paid') end |
.unpaid ⇒ Object
Delivered Duty Unpaid (DDU). See https://en.wikipedia.org/wiki/Incoterms for more information
13584 13585 13586 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13584 def DeliveredDuty.unpaid @@_unpaid ||= DeliveredDuty.new('unpaid') end |
Instance Method Details
#to_hash ⇒ Object
13588 13589 13590 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13588 def to_hash value end |