Class: Io::Flow::V0::Models::ReservationItemForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ReservationItemForm

Returns a new instance of ReservationItemForm.



46473
46474
46475
46476
46477
46478
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46473

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_numberObject (readonly)

Returns the value of attribute item_number.



46471
46472
46473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46471

def item_number
  @item_number
end

#quantityObject (readonly)

Returns the value of attribute quantity.



46471
46472
46473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46471

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46484
46485
46486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46484

def copy(incoming={})
  ReservationItemForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



46488
46489
46490
46491
46492
46493
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46488

def to_hash
  {
    :item_number => item_number,
    :quantity => quantity
  }
end

#to_jsonObject



46480
46481
46482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46480

def to_json
  JSON.dump(to_hash)
end