Module: Mongo::Operation::Executable
- Included in:
- Commands::CollectionsInfo, Commands::Command, Commands::UserQuery, KillCursors, Read::GetMore, Read::Query
- Defined in:
- lib/mongo/operation/executable.rb
Overview
This module provides the #execute method that many operations use. It makes sure to instantiate the appropriate Result class for the operation’s response.
Instance Method Summary collapse
-
#execute(server) ⇒ Result
Execute the operation.
Instance Method Details
#execute(server) ⇒ Result
Execute the operation.
34 35 36 37 38 39 |
# File 'lib/mongo/operation/executable.rb', line 34 def execute(server) server.with_connection do |connection| result_class = self.class.const_defined?(:Result, false) ? self.class::Result : Result result_class.new(connection.dispatch([ (server) ], operation_id)).validate! end end |