Module: Mongoid::Contextual::Command
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongoid/contextual/command.rb |
Overview
Mixin module included in objects which represent database commands.
Instance Attribute Summary
Instance Method Summary
-
#client ⇒ Mongo::Client
Get the database client.
-
#command ⇒ Hash
The database command that is being built to send to the db.
Instance Attribute Details
#collection (readonly)
[ GitHub ]# File 'lib/mongoid/contextual/command.rb', line 12
attr_reader :collection, :criteria
#collection The collection to query against.(The collection to query against.) (readonly)
[ GitHub ]# File 'lib/mongoid/contextual/command.rb', line 12
attr_reader :collection, :criteria
#criteria (readonly)
[ GitHub ]# File 'lib/mongoid/contextual/command.rb', line 12
attr_reader :collection, :criteria
#criteria The criteria for the context.(The criteria for the context.) (readonly)
[ GitHub ]# File 'lib/mongoid/contextual/command.rb', line 12
attr_reader :collection, :criteria
Instance Method Details
#client ⇒ Mongo::Client
Get the database client.
# File 'lib/mongoid/contextual/command.rb', line 30
def client collection.database.client end
#command ⇒ Hash
The database command that is being built to send to the db.
# File 'lib/mongoid/contextual/command.rb', line 20
def command @command ||= {} end