Class: MrMongo::Context

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Context

Returns a new instance of Context.



5
6
7
8
# File 'lib/mr_mongo/context.rb', line 5

def initialize(params = {})
  @db     = params[:db]     if params[:db]
  @params = params[:params] if params[:params]
end

Instance Attribute Details

#dbObject (readonly)

Returns the value of attribute db.



3
4
5
# File 'lib/mr_mongo/context.rb', line 3

def db
  @db
end

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/mr_mongo/context.rb', line 3

def params
  @params
end

Instance Method Details

#params?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/mr_mongo/context.rb', line 10

def params?
  not @params.nil?
end