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.
43138 43139 43140 43141 43142 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43138 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.
43136 43137 43138 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43136 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43148 43149 43150 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43148 def copy(incoming={}) LineItemQuantityForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
43152 43153 43154 43155 43156 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43152 def to_hash { :quantity => quantity } end |
#to_json ⇒ Object
43144 43145 43146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43144 def to_json JSON.dump(to_hash) end |