Class: Moped::Protocol::Command
- Defined in:
- lib/moped/protocol/command.rb
Overview
This is a convenience class on top of Query
for quickly creating a command.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Query
#collection, #database, #fields, #flags, #full_collection_name, #length, #limit, #op_code, #request_id, #selector, #skip
Instance Method Summary collapse
-
#initialize(database, command, options = {}) ⇒ Command
constructor
A new instance of Command.
- #log_inspect ⇒ Object
Methods inherited from Query
Methods included from Message
included, #inspect, #receive_replies, #serialize
Constructor Details
#initialize(database, command, options = {}) ⇒ Command
Returns a new instance of Command.
15 16 17 |
# File 'lib/moped/protocol/command.rb', line 15 def initialize(database, command, = {}) super database, '$cmd', command, .merge(limit: -1) end |
Instance Method Details
#log_inspect ⇒ Object
19 20 21 22 |
# File 'lib/moped/protocol/command.rb', line 19 def log_inspect type = "COMMAND" "%-12s database=%s command=%s" % [type, database, selector.inspect] end |