Class: Io::Flow::V0::Models::Packaging
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Packaging
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents packaging available to ship items
Instance Attribute Summary collapse
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Packaging
constructor
A new instance of Packaging.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Packaging
Returns a new instance of Packaging.
43892 43893 43894 43895 43896 43897 43898 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43892 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:dimensions], 'Packaging') @dimensions = (x = opts.delete(:dimensions); x.is_a?(::Io::Flow::V0::Models::Dimensions) ? x : ::Io::Flow::V0::Models::Dimensions.new(x)) @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String)) @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String)) end |
Instance Attribute Details
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
43890 43891 43892 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43890 def dimensions @dimensions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
43890 43891 43892 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43890 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
43890 43891 43892 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43890 def number @number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43904 43905 43906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43904 def copy(incoming={}) Packaging.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
43908 43909 43910 43911 43912 43913 43914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43908 def to_hash { :dimensions => dimensions.to_hash, :name => name, :number => number } end |
#to_json ⇒ Object
43900 43901 43902 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43900 def to_json JSON.dump(to_hash) end |