Class: Io::Flow::V0::Models::DimensionEstimate
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DimensionEstimate
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DimensionEstimate
constructor
A new instance of DimensionEstimate.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ DimensionEstimate
Returns a new instance of DimensionEstimate.
39782 39783 39784 39785 39786 39787 39788 39789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39782 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :q, :dimensions, :position], 'DimensionEstimate') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String) @dimensions = (x = opts.delete(:dimensions); x.is_a?(::Io::Flow::V0::Models::EstimatedDimensions) ? x : ::Io::Flow::V0::Models::EstimatedDimensions.new(x)) @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer) end |
Instance Attribute Details
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
39780 39781 39782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39780 def dimensions @dimensions end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
39780 39781 39782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39780 def id @id end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
39780 39781 39782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39780 def position @position end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
39780 39781 39782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39780 def q @q end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
39795 39796 39797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39795 def copy(incoming={}) DimensionEstimate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
39799 39800 39801 39802 39803 39804 39805 39806 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39799 def to_hash { :id => id, :q => q, :dimensions => dimensions.to_hash, :position => position } end |
#to_json ⇒ Object
39791 39792 39793 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39791 def to_json JSON.dump(to_hash) end |