Class: Io::Flow::V0::Models::EstimatedDimensions
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::EstimatedDimensions
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ EstimatedDimensions
constructor
A new instance of EstimatedDimensions.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ EstimatedDimensions
Returns a new instance of EstimatedDimensions.
30684 30685 30686 30687 30688 30689 30690 30691 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30684 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:depth, :length, :weight, :width], 'EstimatedDimensions') @depth = (x = opts.delete(:depth); x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)) @length = (x = opts.delete(:length); x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)) @weight = (x = opts.delete(:weight); x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)) @width = (x = opts.delete(:width); x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x)) end |
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
30682 30683 30684 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30682 def depth @depth end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
30682 30683 30684 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30682 def length @length end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
30682 30683 30684 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30682 def weight @weight end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
30682 30683 30684 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30682 def width @width end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30697 30698 30699 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30697 def copy(incoming={}) EstimatedDimensions.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30701 30702 30703 30704 30705 30706 30707 30708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30701 def to_hash { :depth => depth.to_hash, :length => length.to_hash, :weight => weight.to_hash, :width => width.to_hash } end |
#to_json ⇒ Object
30693 30694 30695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30693 def to_json JSON.dump(to_hash) end |