Class: Io::Flow::V0::Models::Hop
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Hop
- 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 = {}) ⇒ Hop
constructor
A new instance of Hop.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Hop
Returns a new instance of Hop.
33152 33153 33154 33155 33156 33157 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33152 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:hop_number, :hop_estimate], 'Hop') @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::HopEstimate) ? x : ::Io::Flow::V0::Models::HopEstimate.new(x)) end |
Instance Attribute Details
#hop_estimate ⇒ Object (readonly)
Returns the value of attribute hop_estimate.
33150 33151 33152 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33150 def hop_estimate @hop_estimate end |
#hop_number ⇒ Object (readonly)
Returns the value of attribute hop_number.
33150 33151 33152 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33150 def hop_number @hop_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33163 33164 33165 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33163 def copy(incoming={}) Hop.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
33167 33168 33169 33170 33171 33172 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33167 def to_hash { :hop_number => hop_number, :hop_estimate => hop_estimate.to_hash } end |
#to_json ⇒ Object
33159 33160 33161 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33159 def to_json JSON.dump(to_hash) end |