Class: IMDB::Configuration

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

Class Method Summary collapse

Class Method Details

.cachingObject



8
9
10
# File 'lib/configuration.rb', line 8

def caching
  @caching
end

.caching=(caching) ⇒ Object



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

def caching=(caching)
  @caching = caching
end

.db(param = {}) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/configuration.rb', line 12

def db(param={})
  @db_hostname = param[:hostname]
  @db_name = param[:database]
  if @caching
    MongoMapper.connection = Mongo::Connection.new(@db_hostname)
    MongoMapper.database = @db_name
  end
end