Class: PrioTicket::Reservation
- Inherits:
-
Object
- Object
- PrioTicket::Reservation
- Defined in:
- lib/prioticket/reservation.rb
Overview
Describes a Reservation
Instance Attribute Summary collapse
-
#booking_details ⇒ Object
Returns the value of attribute booking_details.
-
#booking_status ⇒ Object
Returns the value of attribute booking_status.
-
#cancellation_date_time ⇒ Object
Returns the value of attribute cancellation_date_time.
-
#distributor_id ⇒ Object
Returns the value of attribute distributor_id.
-
#distributor_reference ⇒ Object
Returns the value of attribute distributor_reference.
-
#from_date_time ⇒ Object
Returns the value of attribute from_date_time.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#pickup_point_id ⇒ Object
Returns the value of attribute pickup_point_id.
-
#reservation_reference ⇒ Object
Returns the value of attribute reservation_reference.
-
#ticket_id ⇒ Object
Returns the value of attribute ticket_id.
-
#to_date_time ⇒ Object
Returns the value of attribute to_date_time.
Instance Method Summary collapse
-
#cancel ⇒ Reservation
Cancels the current reservation.
-
#initialize(args) ⇒ Reservation
constructor
A new instance of Reservation.
-
#save ⇒ Object
Sends the reservation request tot the API.
- #success ⇒ Object
Constructor Details
#initialize(args) ⇒ Reservation
Returns a new instance of Reservation.
22 23 24 25 26 27 |
# File 'lib/prioticket/reservation.rb', line 22 def initialize(args) return if args.nil? args.each do |k,v| PrioTicket.parse_json_value(self, k,v) end end |
Instance Attribute Details
#booking_details ⇒ Object
Returns the value of attribute booking_details.
15 16 17 |
# File 'lib/prioticket/reservation.rb', line 15 def booking_details @booking_details end |
#booking_status ⇒ Object
Returns the value of attribute booking_status.
19 20 21 |
# File 'lib/prioticket/reservation.rb', line 19 def booking_status @booking_status end |
#cancellation_date_time ⇒ Object
Returns the value of attribute cancellation_date_time.
20 21 22 |
# File 'lib/prioticket/reservation.rb', line 20 def cancellation_date_time @cancellation_date_time end |
#distributor_id ⇒ Object
Returns the value of attribute distributor_id.
10 11 12 |
# File 'lib/prioticket/reservation.rb', line 10 def distributor_id @distributor_id end |
#distributor_reference ⇒ Object
Returns the value of attribute distributor_reference.
16 17 18 |
# File 'lib/prioticket/reservation.rb', line 16 def distributor_reference @distributor_reference end |
#from_date_time ⇒ Object
Returns the value of attribute from_date_time.
13 14 15 |
# File 'lib/prioticket/reservation.rb', line 13 def from_date_time @from_date_time end |
#identifier ⇒ Object
Returns the value of attribute identifier.
9 10 11 |
# File 'lib/prioticket/reservation.rb', line 9 def identifier @identifier end |
#pickup_point_id ⇒ Object
Returns the value of attribute pickup_point_id.
12 13 14 |
# File 'lib/prioticket/reservation.rb', line 12 def pickup_point_id @pickup_point_id end |
#reservation_reference ⇒ Object
Returns the value of attribute reservation_reference.
18 19 20 |
# File 'lib/prioticket/reservation.rb', line 18 def reservation_reference @reservation_reference end |
#ticket_id ⇒ Object
Returns the value of attribute ticket_id.
11 12 13 |
# File 'lib/prioticket/reservation.rb', line 11 def ticket_id @ticket_id end |
#to_date_time ⇒ Object
Returns the value of attribute to_date_time.
14 15 16 |
# File 'lib/prioticket/reservation.rb', line 14 def to_date_time @to_date_time end |
Instance Method Details
#cancel ⇒ Reservation
Cancels the current reservation
48 49 50 51 |
# File 'lib/prioticket/reservation.rb', line 48 def cancel result = PrioTicket::API.call(cancel_request_body, identifier) parse_result(result) end |
#save ⇒ Object
Sends the reservation request tot the API
40 41 42 |
# File 'lib/prioticket/reservation.rb', line 40 def save request_reservation end |
#success ⇒ Object
29 30 31 |
# File 'lib/prioticket/reservation.rb', line 29 def success booking_status == "Reserved" end |