Class: Io::Flow::V0::Models::DimensionEstimateForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DimensionEstimateForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#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 = {}) ⇒ DimensionEstimateForm
constructor
A new instance of DimensionEstimateForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ DimensionEstimateForm
Returns a new instance of DimensionEstimateForm.
29658 29659 29660 29661 29662 29663 29664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29658 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:q, :dimensions], 'DimensionEstimateForm') @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 = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer)) end |
Instance Attribute Details
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
29656 29657 29658 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29656 def dimensions @dimensions end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
29656 29657 29658 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29656 def position @position end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
29656 29657 29658 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29656 def q @q end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
29670 29671 29672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29670 def copy(incoming={}) DimensionEstimateForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
29674 29675 29676 29677 29678 29679 29680 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29674 def to_hash { :q => q, :dimensions => dimensions.to_hash, :position => position } end |
#to_json ⇒ Object
29666 29667 29668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29666 def to_json JSON.dump(to_hash) end |