Class: OracleOWS::ResvAdvanced
- Defined in:
- lib/oracle_ows/resv_advanced.rb
Overview
- Reservation Advanced Web Service
Instance Attribute Summary
Attributes included from Common
#namespaces, #password, #url, #username
Instance Method Summary collapse
-
#checkin(options = {}) ⇒ Hash
CheckIn.
-
#checkout(options = {}) ⇒ Hash
CheckOut.
-
#initialize(options = {}) ⇒ ResvAdvanced
constructor
initialize the object.
Constructor Details
#initialize(options = {}) ⇒ ResvAdvanced
initialize the object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/oracle_ows/resv_advanced.rb', line 17 def initialize( = {}) # call the parent method, all arguments passed super # we need these for API calls more_namespaces = { 'xmlns:rsa' => 'http://webservices.micros.com/og/4.3/ResvAdvanced/', 'xmlns:com' => 'http://webservices.micros.com/og/4.3/Common/', 'xmlns:hot' => 'http://webservices.micros.com/og/4.3/HotelCommon/', 'xmlns:res' => 'http://webservices.micros.com/og/4.3/Reservation/' } # merge base + additional namespaces @namespaces.merge!(more_namespaces) end |
Instance Method Details
#checkin(options = {}) ⇒ Hash
CheckIn
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/oracle_ows/resv_advanced.rb', line 44 def checkin( = {}) return {} if .blank? response = soap_client.call( :check_in, message: { 'ReservationRequest' => { 'HotelReference' => { '@hotelCode' => [:hotel_code] }, 'KeyTrack' => { '@Key1Track' => [:key_1], '@Key2Track' => [:key_2], '@Key3Track' => [:key_3], '@Key4Track' => [:key_4] } } } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:check_in_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |
#checkout(options = {}) ⇒ Hash
CheckOut
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/oracle_ows/resv_advanced.rb', line 84 def checkout( = {}) return {} if .blank? response = soap_client.call( :check_out, message: { 'ReservationRequest' => { 'HotelReference' => { '@hotelCode' => [:hotel_code] }, 'KeyTrack' => { '@Key1Track' => [:key_1], '@Key2Track' => [:key_2], '@Key3Track' => [:key_3], '@Key4Track' => [:key_4] } } } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:check_out_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |