Class: OracleOWS::HouseKeeping
- Defined in:
- lib/oracle_ows/house_keeping.rb
Overview
- Housekeeping Web Service
-
https://docs.oracle.com/cd/E90572_01/docs/Housekeeping%20Web%20Service%20Specifications.htm
Instance Attribute Summary
Attributes included from Common
#namespaces, #password, #url, #username
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ HouseKeeping
constructor
Initialize.
-
#room_status(options = {}) ⇒ Hash
FetchHouseKeepingRoomStatus.
Constructor Details
#initialize(options = {}) ⇒ HouseKeeping
Initialize
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/oracle_ows/house_keeping.rb', line 19 def initialize( = {}) # call the parent method, all arguments passed super # we need these for API calls more_namespaces = { 'xmlns:hkeep' => 'http://webservices.micros.com/ows/5.1/HouseKeeping.wsdl', 'xmlns:room' => 'http://webservices.micros.com/og/4.3/HouseKeeping/' } # merge base + additional namespaces @namespaces.merge!(more_namespaces) end |
Instance Method Details
#room_status(options = {}) ⇒ Hash
FetchHouseKeepingRoomStatus
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/house_keeping.rb', line 43 def room_status( = {}) return {} if .blank? response = soap_client.call( :fetch_house_keeping_room_status, message: { 'HotelReference' => { '@hotelCode' => [:hotel_code] }, 'Criteria' => { 'FromRoom' => [:room][:from], 'ToRoom' => [:room][:to], 'RoomStatusList' => { 'Code' => 'CLEAN' }, 'HKStatusList' => { 'Code' => 'VACANT' }, 'FOStatusList' => { 'Code' => 'VACANT' }, 'ReservationStatusList' => { 'Code' => 'STAYOVER' } } } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:fetch_house_keeping_room_status_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |