Class: Libis::Services::Rosetta::Client

Inherits:
Object
  • Object
show all
Includes:
SoapClient, Tools::Logger
Defined in:
lib/libis/services/rosetta/client.rb

Instance Attribute Summary

Attributes included from SoapClient

#client

Instance Method Summary collapse

Methods included from SoapClient

#configure, #operations, #request

Constructor Details

#initialize(section, service, options = {}) ⇒ Client

Returns a new instance of Client.



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/libis/services/rosetta/client.rb', line 21

def initialize(section, service, options = {})
  @clear_soap_action = true
  basic_auth = options.delete(:basic_auth)
  if basic_auth
    options[:basic_auth] = [
        "#{basic_auth[:user]}-institutionCode-#{basic_auth[:institution]}",
        basic_auth[:password]
    ]
  end
  opts = {strip_namespaces: true, logger: ::Libis::Tools::Config.logger}.merge options
  base_url = opts.delete(:url) || 'https://repository.teneo.libis.be'
  configure "#{base_url}/dpsws/#{section}/#{service}?wsdl", opts
end

Instance Method Details

#authenticate(user, password, institution) ⇒ Object



39
40
41
42
# File 'lib/libis/services/rosetta/client.rb', line 39

def authenticate(user, password, institution)
  code = Base64.encode64("#{user}-institutionCode-#{institution}:#{password}").gsub("\n", '')
  @auth = "Basic #{code}"
end

#get_heart_bitObject



44
45
46
# File 'lib/libis/services/rosetta/client.rb', line 44

def get_heart_bit
  request :get_heart_bit
end

#pds_handle=(handle) ⇒ Object



35
36
37
# File 'lib/libis/services/rosetta/client.rb', line 35

def pds_handle=(handle)
  @pds_handle = handle
end