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.
19885 19886 19887 19888 19889 19890 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19885 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.
19883 19884 19885 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19883 def likelihood @likelihood end |
#tariff_code ⇒ Object (readonly)
Returns the value of attribute tariff_code.
19883 19884 19885 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19883 def tariff_code @tariff_code end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19896 19897 19898 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19896 def copy(incoming={}) HintResult.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
19900 19901 19902 19903 19904 19905 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19900 def to_hash { :tariff_code => tariff_code.to_hash, :likelihood => likelihood } end |
#to_json ⇒ Object
19892 19893 19894 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19892 def to_json JSON.dump(to_hash) end |