Class: FedoraMigrate::RubydoraConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/fedora_migrate/rubydora_connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ RubydoraConnection

Returns a new instance of RubydoraConnection.



5
6
7
8
9
# File 'lib/fedora_migrate/rubydora_connection.rb', line 5

def initialize(params = {})
  params = params.dup
  self.options = params
  connect
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



3
4
5
# File 'lib/fedora_migrate/rubydora_connection.rb', line 3

def connection
  @connection
end

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/fedora_migrate/rubydora_connection.rb', line 3

def options
  @options
end

Instance Method Details

#connect(force = false) ⇒ Object



11
12
13
14
15
16
# File 'lib/fedora_migrate/rubydora_connection.rb', line 11

def connect(force = false)
  return unless @connection.nil? || force
  allowable_options = [:url, :user, :password, :timeout, :open_timeout, :ssl_client_cert, :ssl_client_key, :validateChecksum]
  client_options = options.reject { |k, _v| !allowable_options.include?(k) }
  @connection = Rubydora.connect client_options
end