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.
9042 9043 9044 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9042 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9040 9041 9042 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9040 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.
9093 9094 9095 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9093 def PriceDetailKey.adjustment @@_adjustment ||= PriceDetailKey.new('adjustment') end |
.ALL ⇒ Object
9062 9063 9064 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9062 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
9047 9048 9049 9050 9051 9052 9053 9054 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9047 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.
9082 9083 9084 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9082 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
9057 9058 9059 9060 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9057 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.
9067 9068 9069 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9067 def PriceDetailKey.item_price @@_item_price ||= PriceDetailKey.new('item_price') end |
.margins ⇒ Object
The details of any margins added to the item price.
9072 9073 9074 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9072 def PriceDetailKey.margins @@_margins ||= PriceDetailKey.new('margins') end |
.rounding ⇒ Object
The details of any rounding added to the item.
9087 9088 9089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9087 def PriceDetailKey.rounding @@_rounding ||= PriceDetailKey.new('rounding') end |
.vat ⇒ Object
The details of any VAT owed on the item.
9077 9078 9079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9077 def PriceDetailKey.vat @@_vat ||= PriceDetailKey.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
9097 9098 9099 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9097 def to_hash value end |