Class: Io::Flow::V0::Models::Dimension
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Dimension
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#diameter ⇒ Object
readonly
Returns the value of attribute diameter.
-
#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 = {}) ⇒ Dimension
constructor
A new instance of Dimension.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Dimension
Returns a new instance of Dimension.
15746 15747 15748 15749 15750 15751 15752 15753 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15746 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @depth = (x = opts.delete(:depth); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x))) @diameter = (x = opts.delete(:diameter); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x))) @length = (x = opts.delete(:length); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x))) @weight = (x = opts.delete(:weight); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Measurement) ? x : ::Io::Flow::V0::Models::Measurement.new(x))) @width = (x = opts.delete(:width); x.nil? ? nil : (x = x; 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.
15744 15745 15746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15744 def depth @depth end |
#diameter ⇒ Object (readonly)
Returns the value of attribute diameter.
15744 15745 15746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15744 def diameter @diameter end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
15744 15745 15746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15744 def length @length end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
15744 15745 15746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15744 def weight @weight end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
15744 15745 15746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15744 def width @width end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15759 15760 15761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15759 def copy(incoming={}) Dimension.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
15763 15764 15765 15766 15767 15768 15769 15770 15771 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15763 def to_hash { :depth => depth.nil? ? nil : depth.to_hash, :diameter => diameter.nil? ? nil : diameter.to_hash, :length => length.nil? ? nil : length.to_hash, :weight => weight.nil? ? nil : weight.to_hash, :width => width.nil? ? nil : width.to_hash } end |
#to_json ⇒ Object
15755 15756 15757 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15755 def to_json JSON.dump(to_hash) end |