Class: Io::Flow::V0::Models::HopV2
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HopV2
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#hop_estimate ⇒ Object
readonly
Returns the value of attribute hop_estimate.
-
#hop_number ⇒ Object
readonly
Returns the value of attribute hop_number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HopV2
constructor
A new instance of HopV2.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ HopV2
Returns a new instance of HopV2.
40001 40002 40003 40004 40005 40006 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40001 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:hop_number, :hop_estimate], 'HopV2') @hop_number = HttpClient::Preconditions.assert_class('hop_number', opts.delete(:hop_number), Integer) @hop_estimate = (x = opts.delete(:hop_estimate); x.is_a?(::Io::Flow::V0::Models::HopEstimateV2) ? x : ::Io::Flow::V0::Models::HopEstimateV2.new(x)) end |
Instance Attribute Details
#hop_estimate ⇒ Object (readonly)
Returns the value of attribute hop_estimate.
39999 40000 40001 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39999 def hop_estimate @hop_estimate end |
#hop_number ⇒ Object (readonly)
Returns the value of attribute hop_number.
39999 40000 40001 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39999 def hop_number @hop_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40012 40013 40014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40012 def copy(incoming={}) HopV2.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40016 40017 40018 40019 40020 40021 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40016 def to_hash { :hop_number => hop_number, :hop_estimate => hop_estimate.to_hash } end |
#to_json ⇒ Object
40008 40009 40010 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40008 def to_json JSON.dump(to_hash) end |