Module: RSolr

Extended by:
Char
Defined in:
lib/rsolr.rb

Defined Under Namespace

Modules: Adapter, Char Classes: Connection, Message, RequestError

Constant Summary collapse

VERSION =
'0.8.2'

Class Method Summary collapse

Methods included from Char

escape

Class Method Details

.connect(options = {}) ⇒ Object

factory for creating connections “options” is a hash that gets used by the Connection object AND the adapter object.



20
21
22
23
24
25
26
27
28
29
# File 'lib/rsolr.rb', line 20

def self.connect(options={})
  adapter_name = options[:adapter] ||= :http
  types = {
    :http=>'HTTP',
    :direct=>'Direct'
  }
  adapter_class = RSolr::Adapter.const_get(types[adapter_name])
  adapter = adapter_class.new(options)
  RSolr::Connection.new(adapter, options)
end