Class: Hungrytable::RestaurantSlotlock
- Inherits:
-
Object
- Object
- Hungrytable::RestaurantSlotlock
- Includes:
- RequestExtensions
- Defined in:
- lib/hungrytable/restaurant_slotlock.rb
Instance Attribute Summary collapse
-
#restaurant_search ⇒ Object
readonly
Returns the value of attribute restaurant_search.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(restaurant_search, requester = PostRequest) ⇒ RestaurantSlotlock
constructor
A new instance of RestaurantSlotlock.
- #params ⇒ Object
- #slotlock_id ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize(restaurant_search, requester = PostRequest) ⇒ RestaurantSlotlock
Returns a new instance of RestaurantSlotlock.
7 8 9 10 |
# File 'lib/hungrytable/restaurant_slotlock.rb', line 7 def initialize restaurant_search, requester=PostRequest @restaurant_search = restaurant_search @requester = requester end |
Instance Attribute Details
#restaurant_search ⇒ Object (readonly)
Returns the value of attribute restaurant_search.
5 6 7 |
# File 'lib/hungrytable/restaurant_slotlock.rb', line 5 def restaurant_search @restaurant_search end |
Instance Method Details
#errors ⇒ Object
16 17 18 |
# File 'lib/hungrytable/restaurant_slotlock.rb', line 16 def errors details["ns:ErrorMessage"] end |
#params ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/hungrytable/restaurant_slotlock.rb', line 25 def params { 'RID' => restaurant.id, 'datetime' => restaurant_search.ideal_time, 'partysize' => restaurant_search.party_size, 'timesecurityID' => restaurant_search.ideal_security_id, 'resultskey' => restaurant_search.results_key } end |
#slotlock_id ⇒ Object
20 21 22 23 |
# File 'lib/hungrytable/restaurant_slotlock.rb', line 20 def slotlock_id return nil unless successful? details["ns:SlotLockID"] end |
#successful? ⇒ Boolean
12 13 14 |
# File 'lib/hungrytable/restaurant_slotlock.rb', line 12 def successful? details["ns:ErrorID"] == "0" end |