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.



34996
34997
34998
34999
35000
35001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34996

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.



34994
34995
34996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34994

def item_number
  @item_number
end

#quantityObject (readonly)

Returns the value of attribute quantity.



34994
34995
34996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34994

def quantity
  @quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35007
35008
35009
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35007

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

#to_hashObject



35011
35012
35013
35014
35015
35016
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35011

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

#to_jsonObject



35003
35004
35005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35003

def to_json
  JSON.dump(to_hash)
end