Class: Io::Flow::V0::Models::Hs6
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Hs6
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The (Harmonized System) HS-6 code assigned to an item.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Hs6
constructor
A new instance of Hs6.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Hs6
Returns a new instance of Hs6.
16289 16290 16291 16292 16293 16294 16295 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16289 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :item, :code], 'Hs6') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::HarmonizedItemReference) ? x : ::Io::Flow::V0::Models::HarmonizedItemReference.new(x)) @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
16287 16288 16289 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16287 def code @code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
16287 16288 16289 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16287 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
16287 16288 16289 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16287 def item @item end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16301 16302 16303 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16301 def copy(incoming={}) Hs6.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16305 16306 16307 16308 16309 16310 16311 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16305 def to_hash { :id => id, :item => item.to_hash, :code => code } end |
#to_json ⇒ Object
16297 16298 16299 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16297 def to_json JSON.dump(to_hash) end |