Class: Io::Flow::V0::Models::PhraseHint
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PhraseHint
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#hs10_code ⇒ Object
readonly
Returns the value of attribute hs10_code.
-
#phrase ⇒ Object
readonly
Returns the value of attribute phrase.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PhraseHint
constructor
A new instance of PhraseHint.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PhraseHint
22535 22536 22537 22538 22539 22540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22535 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:phrase, :hs10_code], 'PhraseHint') @phrase = HttpClient::Preconditions.assert_class('phrase', opts.delete(:phrase), String) @hs10_code = (x = opts.delete(:hs10_code); x.is_a?(::Io::Flow::V0::Models::Hs10Code) ? x : ::Io::Flow::V0::Models::Hs10Code.new(x)) end |
Instance Attribute Details
#hs10_code ⇒ Object (readonly)
Returns the value of attribute hs10_code.
22533 22534 22535 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22533 def hs10_code @hs10_code end |
#phrase ⇒ Object (readonly)
Returns the value of attribute phrase.
22533 22534 22535 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22533 def phrase @phrase end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22546 22547 22548 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22546 def copy(incoming={}) PhraseHint.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22550 22551 22552 22553 22554 22555 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22550 def to_hash { :phrase => phrase, :hs10_code => hs10_code.to_hash } end |
#to_json ⇒ Object
22542 22543 22544 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22542 def to_json JSON.dump(to_hash) end |