Class: Io::Flow::V0::Models::LevyComponent
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LevyComponent
- 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 LevyComponent for this value, creating a new instance for an unknown value.
- .duty ⇒ Object
- .freight ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of LevyComponent for this value, or nil if not found.
-
.goods ⇒ Object
The value of goods.
- .insurance ⇒ Object
-
.vat ⇒ Object
Value-Added Tax.
Instance Method Summary collapse
-
#initialize(value) ⇒ LevyComponent
constructor
A new instance of LevyComponent.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ LevyComponent
Returns a new instance of LevyComponent.
16350 16351 16352 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16350 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16348 16349 16350 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16348 def value @value end |
Class Method Details
.ALL ⇒ Object
16370 16371 16372 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16370 def LevyComponent.ALL @@all ||= [LevyComponent.goods, LevyComponent.duty, LevyComponent.insurance, LevyComponent.freight, LevyComponent.vat] end |
.apply(value) ⇒ Object
Returns the instance of LevyComponent for this value, creating a new instance for an unknown value
16355 16356 16357 16358 16359 16360 16361 16362 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16355 def LevyComponent.apply(value) if value.instance_of?(LevyComponent) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || LevyComponent.new(value)) end end |
.duty ⇒ Object
16379 16380 16381 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16379 def LevyComponent.duty @@_duty ||= LevyComponent.new('duty') end |
.freight ⇒ Object
16387 16388 16389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16387 def LevyComponent.freight @@_freight ||= LevyComponent.new('freight') end |
.from_string(value) ⇒ Object
Returns the instance of LevyComponent for this value, or nil if not found
16365 16366 16367 16368 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16365 def LevyComponent.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) LevyComponent.ALL.find { |v| v.value == value } end |
.goods ⇒ Object
The value of goods
16375 16376 16377 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16375 def LevyComponent.goods @@_goods ||= LevyComponent.new('goods') end |
.insurance ⇒ Object
16383 16384 16385 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16383 def LevyComponent.insurance @@_insurance ||= LevyComponent.new('insurance') end |
.vat ⇒ Object
Value-Added Tax
16392 16393 16394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16392 def LevyComponent.vat @@_vat ||= LevyComponent.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
16396 16397 16398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16396 def to_hash value end |