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.
49062 49063 49064 49065 49066 49067 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49062 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.
49060 49061 49062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49060 def item_number @item_number end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
49060 49061 49062 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49060 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
49073 49074 49075 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49073 def copy(incoming={}) ReservationItemForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
49077 49078 49079 49080 49081 49082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49077 def to_hash { :item_number => item_number, :quantity => quantity } end |
#to_json ⇒ Object
49069 49070 49071 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49069 def to_json JSON.dump(to_hash) end |