Class: OracleOWS::Reservation
- Defined in:
- lib/oracle_ows/reservation.rb
Overview
- Reservation Web Service
-
https://docs.oracle.com/cd/E90572_01/docs/Reservation%20Web%20Service%20Specifications.htm
Instance Attribute Summary
Attributes included from Common
#namespaces, #password, #url, #username
Instance Method Summary collapse
-
#fetch_booked_inventory_items(options = {}) ⇒ Object
Usage: method({ hotel_code: ‘ABC’, type: ‘ABC’, source: ‘ABC’ }).
-
#initialize(options = {}) ⇒ Reservation
constructor
initialize.
-
#pre_checkin(options = {}) ⇒ Hash
PreCheckin.
Constructor Details
#initialize(options = {}) ⇒ Reservation
initialize
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/oracle_ows/reservation.rb', line 17 def initialize( = {}) # call the parent method, all arguments passed super # we need these for API calls more_namespaces = { 'xmlns:res' => 'http://webservices.micros.com/ows/5.1/Reservation.wsdl', 'xmlns:res1' => 'http://webservices.micros.com/og/4.3/Reservation/' } # merge base + this API namespaces @namespaces.merge!(more_namespaces) end |
Instance Method Details
#fetch_booked_inventory_items(options = {}) ⇒ Object
Usage:
method({ hotel_code: 'ABC', type: 'ABC', source: 'ABC' })
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/oracle_ows/reservation.rb', line 66 def fetch_booked_inventory_items( = {}) return {} if .blank? response = soap_client.call( :fetch_booked_inventory_items, message: { 'HotelReference' => { '@hotelCode' => [:hotel_code] } #, # 'ConfirmationNumber' => { '@type' => options[:type], '@source' => options[:source] } } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:fetch_booked_inventory_items_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |
#pre_checkin(options = {}) ⇒ Hash
PreCheckin
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/oracle_ows/reservation.rb', line 40 def pre_checkin( = {}) return {} if .blank? response = soap_client.call( :pre_checkin, message: { 'HotelReference' => { '@hotelCode' => [:hotel_code], '@chainCode' => [:chain_code] }, 'ConfirmationNumber' => [:confirmation] } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:pre_checkin_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |