Class: OracleOWS::Information
- Defined in:
- lib/oracle_ows/information.rb
Overview
- Information Web Service
-
https://docs.oracle.com/cd/E90572_01/docs/Information%20Web%20Service%20Specifications.htm
Instance Attribute Summary
Attributes included from Common
#namespaces, #password, #url, #username
Instance Method Summary collapse
-
#hotel_information(options = {}) ⇒ Object
action: hotel information Usage: hotel_information({ hotel_code: ‘ABC’ }).
-
#initialize(options = {}) ⇒ Information
constructor
initialize the API endpoint object.
Constructor Details
#initialize(options = {}) ⇒ Information
initialize the API endpoint object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/oracle_ows/information.rb', line 17 def initialize( = {}) # call the parent method, all arguments passed super # we need these for API calls more_namespaces = { 'xmlns:inf' => 'http://webservices.micros.com/ows/5.1/Information.wsdl' } # merge base + additional namespaces @namespaces.merge!(more_namespaces) end |
Instance Method Details
#hotel_information(options = {}) ⇒ Object
action: hotel information Usage:
hotel_information({ hotel_code: 'ABC' })
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/oracle_ows/information.rb', line 32 def hotel_information( = {}) return {} if .blank? response = soap_client.call( :query_hotel_information, message: { 'HotelInformationQuery' => { '@hotelCode' => [:hotel_code] } } ) # fetch the response safely (without exception or too many conditional blocks) response.body.dig(:hotel_information_response, :result) # handle exceptions gracefully rescue OracleOWS::Error => e # handle exception gracefully ensure {} # at least return a blank hash end |