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.
18903 18904 18905 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18903 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18901 18902 18903 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18901 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.
18954 18955 18956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18954 def PriceDetailKey.adjustment @@_adjustment ||= PriceDetailKey.new('adjustment') end |
.ALL ⇒ Object
18923 18924 18925 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18923 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
18908 18909 18910 18911 18912 18913 18914 18915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18908 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.
18943 18944 18945 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18943 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
18918 18919 18920 18921 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18918 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.
18928 18929 18930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18928 def PriceDetailKey.item_price @@_item_price ||= PriceDetailKey.new('item_price') end |
.margins ⇒ Object
The details of any margins added to the item price.
18933 18934 18935 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18933 def PriceDetailKey.margins @@_margins ||= PriceDetailKey.new('margins') end |
.rounding ⇒ Object
The details of any rounding added to the item.
18948 18949 18950 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18948 def PriceDetailKey.rounding @@_rounding ||= PriceDetailKey.new('rounding') end |
.vat ⇒ Object
The details of any VAT owed on the item.
18938 18939 18940 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18938 def PriceDetailKey.vat @@_vat ||= PriceDetailKey.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
18958 18959 18960 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18958 def to_hash value end |