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.



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

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

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



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

def connection
  @connection
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#connect(force = false) ⇒ Object



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

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