Module: Mongoid::Contextual::Command
Overview
Mixin module included in objects which represent database commands.
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
- #collection The collection to query against.(Thecollectiontoqueryagainst.) ⇒ Object readonly
-
#criteria ⇒ Object
readonly
Returns the value of attribute criteria.
- #criteria The criteria for the context.(Thecriteria) ⇒ Object readonly
Instance Method Summary collapse
-
#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 ⇒ Object (readonly)
Returns the value of attribute collection.
12 13 14 |
# File 'lib/mongoid/contextual/command.rb', line 12 def collection @collection end |
#collection The collection to query against.(Thecollectiontoqueryagainst.) ⇒ Object (readonly)
12 |
# File 'lib/mongoid/contextual/command.rb', line 12 attr_reader :collection, :criteria |
#criteria ⇒ Object (readonly)
Returns the value of attribute criteria.
12 13 14 |
# File 'lib/mongoid/contextual/command.rb', line 12 def criteria @criteria end |
#criteria The criteria for the context.(Thecriteria) ⇒ Object (readonly)
12 |
# File 'lib/mongoid/contextual/command.rb', line 12 attr_reader :collection, :criteria |
Instance Method Details
#client ⇒ Mongo::Client
Get the database client.
30 31 32 |
# 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.
20 21 22 |
# File 'lib/mongoid/contextual/command.rb', line 20 def command @command ||= {} end |