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
-
.adjustment ⇒ Object
The details of any price adjustments due to sales margins.
- .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.
17131 17132 17133 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17131 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17129 17130 17131 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17129 def value @value end |
Class Method Details
.adjustment ⇒ Object
The details of any price adjustments due to sales margins. A negative value indicates a discount.
17182 17183 17184 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17182 def PriceDetailKey.adjustment @@_adjustment ||= PriceDetailKey.new('adjustment') end |
.ALL ⇒ Object
17151 17152 17153 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17151 def PriceDetailKey.ALL @@all ||= [PriceDetailKey.item_price, PriceDetailKey.margins, PriceDetailKey.vat, PriceDetailKey.duty, PriceDetailKey.rounding, PriceDetailKey.adjustment] end |
.apply(value) ⇒ Object
Returns the instance of PriceDetailKey for this value, creating a new instance for an unknown value
17136 17137 17138 17139 17140 17141 17142 17143 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17136 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.
17171 17172 17173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17171 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
17146 17147 17148 17149 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17146 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.
17156 17157 17158 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17156 def PriceDetailKey.item_price @@_item_price ||= PriceDetailKey.new('item_price') end |
.margins ⇒ Object
The details of any margins added to the item price.
17161 17162 17163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17161 def PriceDetailKey.margins @@_margins ||= PriceDetailKey.new('margins') end |
.rounding ⇒ Object
The details of any rounding added to the item.
17176 17177 17178 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17176 def PriceDetailKey.rounding @@_rounding ||= PriceDetailKey.new('rounding') end |
.vat ⇒ Object
The details of any VAT owed on the item.
17166 17167 17168 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17166 def PriceDetailKey.vat @@_vat ||= PriceDetailKey.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
17186 17187 17188 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17186 def to_hash value end |