Class: Io::Flow::V0::Models::ReservationItemForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReservationItemForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReservationItemForm
constructor
A new instance of ReservationItemForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReservationItemForm
Returns a new instance of ReservationItemForm.
48501 48502 48503 48504 48505 48506 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48501 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item_number, :quantity], 'ReservationItemForm') @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) end |
Instance Attribute Details
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
48499 48500 48501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48499 def item_number @item_number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
48499 48500 48501 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48499 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
48512 48513 48514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48512 def copy(incoming={}) ReservationItemForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
48516 48517 48518 48519 48520 48521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48516 def to_hash { :item_number => item_number, :quantity => quantity } end |
#to_json ⇒ Object
48508 48509 48510 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48508 def to_json JSON.dump(to_hash) end |