Module: Rack::GridFS::Endpoint::Connection

Included in:
Rack::GridFS::Endpoint
Defined in:
lib/rack/gridfs/endpoint/connection.rb

Instance Method Summary collapse

Instance Method Details

#dbObject


22
23
24
# File 'lib/rack/gridfs/endpoint/connection.rb', line 22

def db
  @db ||= (super || connect!)
end

#default_optionsObject


15
16
17
18
19
20
# File 'lib/rack/gridfs/endpoint/connection.rb', line 15

def default_options
  super.merge({
    :hostname => 'localhost',
    :port     => Mongo::Connection::DEFAULT_PORT
  })
end

#initializeObject


8
9
10
11
12
13
# File 'lib/rack/gridfs/endpoint/connection.rb', line 8

def initialize(*)
  super

  @hostname, @port, @database, @username, @password =
    @options.values_at(:hostname, :port, :database, :username, :password)
end