Class: DLDInternet::OpenSRS::API::Base

Inherits:
Object
  • Object
show all
Includes:
MixIns::Cookie
Defined in:
lib/dldinternet/opensrs/api/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MixIns::Cookie

#cookie

Constructor Details

#initialize(options, logger = nil) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
# File 'lib/dldinternet/opensrs/api/base.rb', line 9

def initialize(options, logger=nil)
  @options = options
  @logger  = logger
  ::OpenSRS::Server.xml_processor = :nokogiri
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



7
8
9
# File 'lib/dldinternet/opensrs/api/base.rb', line 7

def logger
  @logger
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/dldinternet/opensrs/api/base.rb', line 7

def options
  @options
end

Instance Method Details

#serverObject



15
16
17
18
19
20
21
22
23
# File 'lib/dldinternet/opensrs/api/base.rb', line 15

def server
  @server ||= ::OpenSRS::Server.new(
      :server   => options[:server],
      :username => options[:username],
      :password => options[:password],
      :key      => options[:key     ],
      :logger   => @logger
  )
end