Class: Io::Flow::V0::Models::Hs10Code
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Hs10Code
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Harmonized System codes for specific countries, up to 10 digits (HS-10). Not all countries use all 10 digits of precision.
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.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Hs10Code
constructor
A new instance of Hs10Code.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Hs10Code
Returns a new instance of Hs10Code.
16915 16916 16917 16918 16919 16920 16921 16922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16915 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code, :destination], 'Hs10Code') @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String) @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String) @parent = (x = opts.delete(:parent); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent', x, 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.
16913 16914 16915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16913 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
16913 16914 16915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16913 def description @description end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
16913 16914 16915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16913 def destination @destination end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
16913 16914 16915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16913 def parent @parent end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16928 16929 16930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16928 def copy(incoming={}) Hs10Code.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16932 16933 16934 16935 16936 16937 16938 16939 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16932 def to_hash { :code => code, :destination => destination, :parent => parent, :description => description } end |
#to_json ⇒ Object
16924 16925 16926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16924 def to_json JSON.dump(to_hash) end |