Class: OracleOWS::GuestServices
- Defined in:
- lib/oracle_ows/guest_services.rb
Overview
- Guest Services Web Service
-
https://docs.oracle.com/cd/E90572_01/docs/Guest%20Services%20Web%20Service%20Specification.htm
Instance Attribute Summary
Attributes included from Common
#namespaces, #password, #url, #username
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GuestServices
constructor
Initialize.
-
#update_room_status(options = {}) ⇒ Hash
Update Room Status.
-
#wake_up_call(options = {}) ⇒ Hash
Wake Up Call.
Constructor Details
#initialize(options = {}) ⇒ GuestServices
Initialize
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/oracle_ows/guest_services.rb', line 19 def initialize( = {}) # call the parent method, all arguments passed super # we need these for API calls more_namespaces = { 'xmlns:gue' => 'http://webservices.micros.com/og/4.3/GuestServices/', 'xmlns:hot' => 'http://webservices.micros.com/og/4.3/HotelCommon/' } # merge base + additional namespaces @namespaces.merge!(more_namespaces) end |
Instance Method Details
#update_room_status(options = {}) ⇒ Hash
Update Room Status
41 42 43 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 |
# File 'lib/oracle_ows/guest_services.rb', line 41 def update_room_status( = {}) # save resources if we have nothing to do return {} if .blank? # make the SOAP API call response = soap_client.call( # endpoint action :update_room_status, # payload message: { 'HotelReference' => { '@hotelCode' => [:hotel_code] }, 'RoomNumber' => [:room], 'RoomStatus' => 'Clean', 'TurnDownStatus' => 'Completed', 'GuestServiceStatus' => 'DoNotDisturb' } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:update_room_status_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |
#wake_up_call(options = {}) ⇒ Hash
Wake Up Call
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/oracle_ows/guest_services.rb', line 80 def wake_up_call( = {}) return {} if .blank? response = soap_client.call( :wake_up_call, message: { 'HotelReference' => { '@hotelCode' => [:hotel_code] }, 'RoomNumber' => [:room] } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:wake_up_call_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |