Class: Hungrytable::ReservationMake
- Inherits:
-
Object
- Object
- Hungrytable::ReservationMake
- Includes:
- RequestExtensions
- Defined in:
- lib/hungrytable/reservation_make.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#restaurant_slotlock ⇒ Object
readonly
Returns the value of attribute restaurant_slotlock.
Instance Method Summary collapse
- #confirmation_number ⇒ Object
-
#initialize(restaurant_slotlock, opts = {}) ⇒ ReservationMake
constructor
A new instance of ReservationMake.
- #successful? ⇒ Boolean
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
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
5 6 7 |
# File 'lib/hungrytable/reservation_make.rb', line 5 def opts @opts end |
#restaurant_slotlock ⇒ Object (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_number ⇒ Object
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
14 15 16 |
# File 'lib/hungrytable/reservation_make.rb', line 14 def successful? details["ns:ErrorID"] == "0" end |