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.
74 75 76 |
# File 'lib/droonga/plugin/handler/groonga.rb', line 74 def initialize(context) @context = context end |
Instance Method Details
#execute(request) ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/droonga/plugin/handler/groonga.rb', line 78 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 |