Class: Io::Flow::V0::Models::TariffCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TariffCode
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Harmonized System codes for specific products imported into specific countries. These are between 4 and 12 digits and are used to select the correct duty rate.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TariffCode
constructor
A new instance of TariffCode.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TariffCode
Returns a new instance of TariffCode.
41665 41666 41667 41668 41669 41670 41671 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41665 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code, :destination], 'TariffCode') @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String) @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
41663 41664 41665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41663 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
41663 41664 41665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41663 def description @description end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
41663 41664 41665 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41663 def destination @destination end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41677 41678 41679 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41677 def copy(incoming={}) TariffCode.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41681 41682 41683 41684 41685 41686 41687 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41681 def to_hash { :code => code, :destination => destination, :description => description } end |
#to_json ⇒ Object
41673 41674 41675 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41673 def to_json JSON.dump(to_hash) end |