Class: Centaman::Service::HoldTicket
- Inherits:
-
Centaman::Service
- Object
- Wrapper
- Centaman::Service
- Centaman::Service::HoldTicket
- Defined in:
- lib/centaman/service/hold_ticket.rb
Constant Summary
Constants inherited from Wrapper
Instance Attribute Summary collapse
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#timed_ticket_id ⇒ Object
readonly
Returns the value of attribute timed_ticket_id.
-
#timed_ticket_type_id ⇒ Object
readonly
Returns the value of attribute timed_ticket_type_id.
Attributes inherited from Wrapper
#api_password, #api_token, #api_url, #api_username, #proxie_host, #proxie_password, #proxie_port, #proxie_user
Instance Method Summary collapse
- #after_init(args) ⇒ Object
- #after_post(response) ⇒ Object
- #endpoint ⇒ Object
- #object_class ⇒ Object
- #options ⇒ Object
- #options_hash ⇒ Object
Methods inherited from Centaman::Service
Methods inherited from Wrapper
#generate_token, #headers, #initialize, #payload, #payload_key, #proxy_hash, #wrap_request_in_case_of_timeout
Constructor Details
This class inherits a constructor from Centaman::Wrapper
Instance Attribute Details
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
3 4 5 |
# File 'lib/centaman/service/hold_ticket.rb', line 3 def quantity @quantity end |
#timed_ticket_id ⇒ Object (readonly)
Returns the value of attribute timed_ticket_id.
3 4 5 |
# File 'lib/centaman/service/hold_ticket.rb', line 3 def timed_ticket_id @timed_ticket_id end |
#timed_ticket_type_id ⇒ Object (readonly)
Returns the value of attribute timed_ticket_type_id.
3 4 5 |
# File 'lib/centaman/service/hold_ticket.rb', line 3 def timed_ticket_type_id @timed_ticket_type_id end |
Instance Method Details
#after_init(args) ⇒ Object
5 6 7 8 9 |
# File 'lib/centaman/service/hold_ticket.rb', line 5 def after_init(args) @timed_ticket_type_id = args[:timed_ticket_type_id] @timed_ticket_id = args[:timed_ticket_id] @quantity = args[:quantity] end |
#after_post(response) ⇒ Object
11 12 13 |
# File 'lib/centaman/service/hold_ticket.rb', line 11 def after_post(response) response.parsed_response end |
#endpoint ⇒ Object
15 16 17 |
# File 'lib/centaman/service/hold_ticket.rb', line 15 def endpoint '/ticket_services/TimedTicketType' end |
#object_class ⇒ Object
19 20 21 |
# File 'lib/centaman/service/hold_ticket.rb', line 19 def object_class Centaman::Object::BookingTime end |
#options ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/centaman/service/hold_ticket.rb', line 33 def super + [ { key: 'TimedTicketTypeId', value: timed_ticket_type_id.to_i }, { key: 'TimedTicketId', value: timed_ticket_id }, { key: 'NumberOfTickets', value: quantity } ] end |
#options_hash ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/centaman/service/hold_ticket.rb', line 23 def [ { 'TimedTicketTypeId' => timed_ticket_type_id.to_i, 'TimedTicketId' => timed_ticket_id, 'NumberOfTickets' => quantity } ].to_json end |