Class: Hungrytable::ReservationCancel
- Inherits:
-
Object
- Object
- Hungrytable::ReservationCancel
- Includes:
- RequestExtensions
- Defined in:
- lib/hungrytable/reservation_cancel.rb
Overview
Cancels an existing restaurant reservation
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#error_message ⇒ String?
Get error messages if cancellation failed.
-
#initialize(opts = {}) ⇒ ReservationCancel
constructor
A new instance of ReservationCancel.
-
#successful? ⇒ Boolean
Check if the cancellation was successful.
Constructor Details
#initialize(opts = {}) ⇒ ReservationCancel
Returns a new instance of ReservationCancel.
10 11 12 13 14 |
# File 'lib/hungrytable/reservation_cancel.rb', line 10 def initialize(opts = {}) @opts = opts ensure_required_opts @requester = opts[:requester] || GetRequest end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
8 9 10 |
# File 'lib/hungrytable/reservation_cancel.rb', line 8 def opts @opts end |
Instance Method Details
#error_message ⇒ String?
Get error messages if cancellation failed
24 25 26 |
# File 'lib/hungrytable/reservation_cancel.rb', line 24 def details['ns:ErrorMessage'] end |
#successful? ⇒ Boolean
Check if the cancellation was successful
18 19 20 |
# File 'lib/hungrytable/reservation_cancel.rb', line 18 def successful? details['ns:ErrorID'].to_s == '0' end |