Class: MrMongo::Context
- Inherits:
-
Object
- Object
- MrMongo::Context
- Defined in:
- lib/mr_mongo/context.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Context
constructor
A new instance of Context.
- #params? ⇒ Boolean
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
#db ⇒ Object (readonly)
Returns the value of attribute db.
3 4 5 |
# File 'lib/mr_mongo/context.rb', line 3 def db @db end |
#params ⇒ Object (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
10 11 12 |
# File 'lib/mr_mongo/context.rb', line 10 def params? not @params.nil? end |