Class: Io::Flow::V0::Models::PhraseHint

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_codeObject (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

#phraseObject (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_hashObject



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_jsonObject



22542
22543
22544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22542

def to_json
  JSON.dump(to_hash)
end