Class: Droonga::GroongaHandler::Command
- Inherits:
-
Object
- Object
- Droonga::GroongaHandler::Command
- Defined in:
- lib/droonga/plugin/handler/groonga.rb
Direct Known Subclasses
Defined Under Namespace
Classes: CommandError
Instance Method Summary collapse
- #execute(request) ⇒ Object
-
#initialize(context) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(context) ⇒ Command
Returns a new instance of Command.
60 61 62 |
# File 'lib/droonga/plugin/handler/groonga.rb', line 60 def initialize(context) @context = context end |
Instance Method Details
#execute(request) ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/droonga/plugin/handler/groonga.rb', line 64 def execute(request) @start_time = Time.now.to_f result = process_request(request) [header(Status::SUCCESS), result] rescue CommandError => error [header(error.status, error.), error.result] end |