Class: Io::Flow::V0::Models::Dimensions
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Dimensions
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#packaging ⇒ Object
readonly
Returns the value of attribute packaging.
-
#product ⇒ Object
readonly
Returns the value of attribute product.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Dimensions
constructor
A new instance of Dimensions.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Dimensions
Returns a new instance of Dimensions.
39876 39877 39878 39879 39880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39876 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @product = (x = opts.delete(:product); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x))) @packaging = (x = opts.delete(:packaging); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x))) end |
Instance Attribute Details
#packaging ⇒ Object (readonly)
Returns the value of attribute packaging.
39874 39875 39876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39874 def packaging @packaging end |
#product ⇒ Object (readonly)
Returns the value of attribute product.
39874 39875 39876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39874 def product @product end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
39886 39887 39888 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39886 def copy(incoming={}) Dimensions.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
39890 39891 39892 39893 39894 39895 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39890 def to_hash { :product => product.nil? ? nil : product.to_hash, :packaging => packaging.nil? ? nil : packaging.to_hash } end |
#to_json ⇒ Object
39882 39883 39884 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39882 def to_json JSON.dump(to_hash) end |