class OracleOWS::Information

Information Web Service

{docs.oracle.com/cd/E90572_01/docs/Information%20Web%20Service%20Specifications.htm}

Public Class Methods

new(options = {}) click to toggle source

initialize the API endpoint object

@param [OracleOws::Base] base object with initial parameters

Calls superclass method OracleOWS::Base::new
# File lib/oracle_ows/information.rb, line 17
def initialize(options = {})
  # 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

Public Instance Methods

hotel_information(options = {}) click to toggle source

action: hotel information Usage:

hotel_information({ hotel_code: 'ABC' })
# File lib/oracle_ows/information.rb, line 32
def hotel_information(options = {})
  return {} if options.blank?

  response = soap_client.call(
    :query_hotel_information,
    message: {
      'HotelInformationQuery' => { '@hotelCode' => options[: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