Class: Io::Flow::V0::Models::PriceDetailKey
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceDetailKey
- 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 PriceDetailKey for this value, creating a new instance for an unknown value.
-
.duty ⇒ Object
The details of any duties owed on the item.
-
.from_string(value) ⇒ Object
Returns the instance of PriceDetailKey for this value, or nil if not found.
-
.item_price ⇒ Object
The details of the item price.
-
.margins ⇒ Object
The details of any margins added to the item price.
-
.rounding ⇒ Object
The details of any rounding added to the item.
-
.vat ⇒ Object
The details of any VAT owed on the item.
Instance Method Summary collapse
-
#initialize(value) ⇒ PriceDetailKey
constructor
A new instance of PriceDetailKey.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ PriceDetailKey
Returns a new instance of PriceDetailKey.
6785 6786 6787 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6785 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6783 6784 6785 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6783 def value @value end |
Class Method Details
.ALL ⇒ Object
6805 6806 6807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6805 def PriceDetailKey.ALL @@all ||= [PriceDetailKey.item_price, PriceDetailKey.margins, PriceDetailKey.vat, PriceDetailKey.duty, PriceDetailKey.rounding] end |
.apply(value) ⇒ Object
Returns the instance of PriceDetailKey for this value, creating a new instance for an unknown value
6790 6791 6792 6793 6794 6795 6796 6797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6790 def PriceDetailKey.apply(value) if value.instance_of?(PriceDetailKey) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || PriceDetailKey.new(value)) end end |
.duty ⇒ Object
The details of any duties owed on the item.
6825 6826 6827 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6825 def PriceDetailKey.duty @@_duty ||= PriceDetailKey.new('duty') end |
.from_string(value) ⇒ Object
Returns the instance of PriceDetailKey for this value, or nil if not found
6800 6801 6802 6803 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6800 def PriceDetailKey.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) PriceDetailKey.ALL.find { |v| v.value == value } end |
.item_price ⇒ Object
The details of the item price.
6810 6811 6812 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6810 def PriceDetailKey.item_price @@_item_price ||= PriceDetailKey.new('item_price') end |
.margins ⇒ Object
The details of any margins added to the item price.
6815 6816 6817 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6815 def PriceDetailKey.margins @@_margins ||= PriceDetailKey.new('margins') end |
.rounding ⇒ Object
The details of any rounding added to the item.
6830 6831 6832 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6830 def PriceDetailKey.rounding @@_rounding ||= PriceDetailKey.new('rounding') end |
.vat ⇒ Object
The details of any VAT owed on the item.
6820 6821 6822 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6820 def PriceDetailKey.vat @@_vat ||= PriceDetailKey.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
6834 6835 6836 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6834 def to_hash value end |