Class: Io::Flow::V0::Models::LineItemQuantityForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LineItemQuantityForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LineItemQuantityForm
constructor
A new instance of LineItemQuantityForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LineItemQuantityForm
Returns a new instance of LineItemQuantityForm.
38141 38142 38143 38144 38145 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38141 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:quantity], 'LineItemQuantityForm') @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) end |
Instance Attribute Details
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
38139 38140 38141 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38139 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38151 38152 38153 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38151 def copy(incoming={}) LineItemQuantityForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38155 38156 38157 38158 38159 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38155 def to_hash { :quantity => quantity } end |
#to_json ⇒ Object
38147 38148 38149 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38147 def to_json JSON.dump(to_hash) end |