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
-
#phrase ⇒ Object
readonly
Returns the value of attribute phrase.
-
#tariff_code ⇒ Object
readonly
Returns the value of attribute tariff_code.
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
Returns a new instance of PhraseHint.
23672 23673 23674 23675 23676 23677 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23672 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:phrase, :tariff_code], 'PhraseHint') @phrase = HttpClient::Preconditions.assert_class('phrase', opts.delete(:phrase), String) @tariff_code = (x = opts.delete(:tariff_code); x.is_a?(::Io::Flow::V0::Models::TariffCode) ? x : ::Io::Flow::V0::Models::TariffCode.new(x)) end |
Instance Attribute Details
#phrase ⇒ Object (readonly)
Returns the value of attribute phrase.
23670 23671 23672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23670 def phrase @phrase end |
#tariff_code ⇒ Object (readonly)
Returns the value of attribute tariff_code.
23670 23671 23672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23670 def tariff_code @tariff_code end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23683 23684 23685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23683 def copy(incoming={}) PhraseHint.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
23687 23688 23689 23690 23691 23692 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23687 def to_hash { :phrase => phrase, :tariff_code => tariff_code.to_hash } end |
#to_json ⇒ Object
23679 23680 23681 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23679 def to_json JSON.dump(to_hash) end |