Class: Io::Flow::V0::Models::HarmonizedLandedCostItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HarmonizedLandedCostItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Duty and tax information for a given item. Note that the internal implementation supports multiple countries of origin.
Instance Attribute Summary collapse
-
#duty ⇒ Object
readonly
Returns the value of attribute duty.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#tax ⇒ Object
readonly
Returns the value of attribute tax.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HarmonizedLandedCostItem
constructor
A new instance of HarmonizedLandedCostItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ HarmonizedLandedCostItem
Returns a new instance of HarmonizedLandedCostItem.
17636 17637 17638 17639 17640 17641 17642 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17636 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item, :duty, :tax], 'HarmonizedLandedCostItem') @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::HarmonizedItemReference) ? x : ::Io::Flow::V0::Models::HarmonizedItemReference.new(x)) @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Duty) ? x : ::Io::Flow::V0::Models::Duty.new(x)) @tax = (x = opts.delete(:tax); x.is_a?(::Io::Flow::V0::Models::Tax) ? x : ::Io::Flow::V0::Models::Tax.new(x)) end |
Instance Attribute Details
#duty ⇒ Object (readonly)
Returns the value of attribute duty.
17634 17635 17636 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17634 def duty @duty end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
17634 17635 17636 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17634 def item @item end |
#tax ⇒ Object (readonly)
Returns the value of attribute tax.
17634 17635 17636 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17634 def tax @tax end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17648 17649 17650 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17648 def copy(incoming={}) HarmonizedLandedCostItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
17652 17653 17654 17655 17656 17657 17658 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17652 def to_hash { :item => item.to_hash, :duty => duty.to_hash, :tax => tax.to_hash } end |
#to_json ⇒ Object
17644 17645 17646 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17644 def to_json JSON.dump(to_hash) end |