Class: Hungrytable::ReservationMake

Inherits:
Object
  • Object
show all
Includes:
RequestExtensions
Defined in:
lib/hungrytable/reservation_make.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(restaurant_slotlock, opts = {}) ⇒ ReservationMake

Returns a new instance of ReservationMake.



7
8
9
10
11
12
# File 'lib/hungrytable/reservation_make.rb', line 7

def initialize restaurant_slotlock, opts={}
  @opts = opts
  ensure_required_opts
  @requester           = opts[:requester] || PostRequest
  @restaurant_slotlock = restaurant_slotlock
end

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



5
6
7
# File 'lib/hungrytable/reservation_make.rb', line 5

def opts
  @opts
end

#restaurant_slotlockObject (readonly)

Returns the value of attribute restaurant_slotlock.



5
6
7
# File 'lib/hungrytable/reservation_make.rb', line 5

def restaurant_slotlock
  @restaurant_slotlock
end

Instance Method Details

#confirmation_numberObject



18
19
20
21
# File 'lib/hungrytable/reservation_make.rb', line 18

def confirmation_number
  return nil unless successful?
  details["ns:ConfirmationNumber"]
end

#successful?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/hungrytable/reservation_make.rb', line 14

def successful?
  details["ns:ErrorID"] == "0"
end