Class: Io::Flow::V0::Models::HintResult
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HintResult
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Result of looking up a code using a hint.
Instance Attribute Summary collapse
-
#likelihood ⇒ Object
readonly
Returns the value of attribute likelihood.
-
#tariff_code ⇒ Object
readonly
Returns the value of attribute tariff_code.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HintResult
constructor
A new instance of HintResult.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ HintResult
Returns a new instance of HintResult.
20370 20371 20372 20373 20374 20375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20370 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:tariff_code, :likelihood], 'HintResult') @tariff_code = (x = opts.delete(:tariff_code); x.is_a?(::Io::Flow::V0::Models::TariffCode) ? x : ::Io::Flow::V0::Models::TariffCode.new(x)) @likelihood = HttpClient::Preconditions.assert_class('likelihood', HttpClient::Helper.to_big_decimal(opts.delete(:likelihood)), BigDecimal) end |
Instance Attribute Details
#likelihood ⇒ Object (readonly)
Returns the value of attribute likelihood.
20368 20369 20370 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20368 def likelihood @likelihood end |
#tariff_code ⇒ Object (readonly)
Returns the value of attribute tariff_code.
20368 20369 20370 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20368 def tariff_code @tariff_code end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20381 20382 20383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20381 def copy(incoming={}) HintResult.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
20385 20386 20387 20388 20389 20390 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20385 def to_hash { :tariff_code => tariff_code.to_hash, :likelihood => likelihood } end |
#to_json ⇒ Object
20377 20378 20379 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20377 def to_json JSON.dump(to_hash) end |