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.
10392 10393 10394 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10392 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10390 10391 10392 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10390 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.
10443 10444 10445 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10443 def PriceDetailKey.adjustment @@_adjustment ||= PriceDetailKey.new('adjustment') end |
.ALL ⇒ Object
10412 10413 10414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10412 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
10397 10398 10399 10400 10401 10402 10403 10404 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10397 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.
10432 10433 10434 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10432 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
10407 10408 10409 10410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10407 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.
10417 10418 10419 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10417 def PriceDetailKey.item_price @@_item_price ||= PriceDetailKey.new('item_price') end |
.margins ⇒ Object
The details of any margins added to the item price.
10422 10423 10424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10422 def PriceDetailKey.margins @@_margins ||= PriceDetailKey.new('margins') end |
.rounding ⇒ Object
The details of any rounding added to the item.
10437 10438 10439 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10437 def PriceDetailKey.rounding @@_rounding ||= PriceDetailKey.new('rounding') end |
.vat ⇒ Object
The details of any VAT owed on the item.
10427 10428 10429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10427 def PriceDetailKey.vat @@_vat ||= PriceDetailKey.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
10447 10448 10449 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10447 def to_hash value end |