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.
17756 17757 17758 17759 17760 17761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17756 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.
17754 17755 17756 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17754 def likelihood @likelihood end |
#tariff_code ⇒ Object (readonly)
Returns the value of attribute tariff_code.
17754 17755 17756 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17754 def tariff_code @tariff_code end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17767 17768 17769 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17767 def copy(incoming={}) HintResult.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
17771 17772 17773 17774 17775 17776 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17771 def to_hash { :tariff_code => tariff_code.to_hash, :likelihood => likelihood } end |
#to_json ⇒ Object
17763 17764 17765 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17763 def to_json JSON.dump(to_hash) end |