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.
8247 8248 8249 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8247 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8245 8246 8247 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8245 def value @value end |
Class Method Details
.ALL ⇒ Object
8267 8268 8269 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8267 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
8252 8253 8254 8255 8256 8257 8258 8259 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8252 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
8262 8263 8264 8265 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8262 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
8273 8274 8275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8273 def DeliveredDuty.paid @@_paid ||= DeliveredDuty.new('paid') end |
.unpaid ⇒ Object
Delivered Duty Unpaid (DDU). See en.wikipedia.org/wiki/Incoterms for more information
8279 8280 8281 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8279 def DeliveredDuty.unpaid @@_unpaid ||= DeliveredDuty.new('unpaid') end |
Instance Method Details
#to_hash ⇒ Object
8283 8284 8285 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8283 def to_hash value end |