Class: Libis::Services::Rosetta::Client
- Inherits:
-
Object
- Object
- Libis::Services::Rosetta::Client
- Includes:
- SoapClient, Tools::Logger
- Defined in:
- lib/libis/services/rosetta/client.rb
Direct Known Subclasses
CollectionHandler, DepositHandler, IeHandler, ProducerHandler, SipHandler, UserManager
Instance Attribute Summary
Attributes included from SoapClient
Instance Method Summary collapse
- #authenticate(user, password, institution) ⇒ Object
- #get_heart_bit ⇒ Object
-
#initialize(section, service, options = {}) ⇒ Client
constructor
A new instance of Client.
- #pds_handle=(handle) ⇒ Object
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, = {}) @clear_soap_action = true basic_auth = .delete(:basic_auth) if basic_auth [:basic_auth] = [ "#{basic_auth[:user]}-institutionCode-#{basic_auth[:institution]}", basic_auth[:password] ] end opts = {strip_namespaces: true, logger: ::Libis::Tools::Config.logger}.merge 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_bit ⇒ Object
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 |