Class: OracleOWS::Base

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/oracle_ows/base.rb

Overview

OracleOws::Base stores basic parameters to connect to the service

Instance Attribute Summary

Attributes included from Common

#namespaces, #password, #url, #username

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Instantiates the OracleOWS::Base object

Parameters:

  • options (Hash) (defaults to: {})

    contains a hash of parameters to beused for every API call

Options Hash (options):

  • :url (String)

    base URL of the SOAP API endpoint

  • :username (String)

    login username

  • :password (String)

    password to use

  • :namespaces (Hash)

    a hash of XML namespaces to use as headers



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/oracle_ows/base.rb', line 25

def initialize(options = {})
  # { url: 'http://some.domain/path/' }
  @url = options[:url]
  # { username: 'abc' }
  @username = options[:username]
  # { password: 'abc' }
  @password = options[:password]
  # basic namespaces required at least, to begin with
  @namespaces = {
    'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
    'xmlns:cor' => 'http://webservices.micros.com/og/4.3/Core/'
  }
  # merge any additional given namespaces
  @namespaces.merge!(options[:namespaces] || {})
end