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.
37438 37439 37440 37441 37442 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37438 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.
37436 37437 37438 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37436 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
37448 37449 37450 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37448 def copy(incoming={}) LineItemQuantityForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
37452 37453 37454 37455 37456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37452 def to_hash { :quantity => quantity } end |
#to_json ⇒ Object
37444 37445 37446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37444 def to_json JSON.dump(to_hash) end |