Class: Droonga::Plugins::Groonga::GenericCommand
- Inherits:
-
Object
- Object
- Droonga::Plugins::Groonga::GenericCommand
- Defined in:
- lib/droonga/plugins/groonga/generic_command.rb
Direct Known Subclasses
ColumnCreate::Command, ColumnList::Command, ColumnRemove::Command, ColumnRename::Command, Delete::Command, TableCreate::Command, TableList::Command, TableRemove::Command
Defined Under Namespace
Classes: CommandError
Instance Method Summary collapse
- #execute(request) ⇒ Object
-
#initialize(context) ⇒ GenericCommand
constructor
A new instance of GenericCommand.
Constructor Details
#initialize(context) ⇒ GenericCommand
Returns a new instance of GenericCommand.
38 39 40 |
# File 'lib/droonga/plugins/groonga/generic_command.rb', line 38 def initialize(context) @context = context end |
Instance Method Details
#execute(request) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/droonga/plugins/groonga/generic_command.rb', line 42 def execute(request) @start_time = Time.now.to_f result = process_request(request) [header(Status::SUCCESS), result] rescue CommandError => error unless error.result.nil? [header(error.status, error.), error.result] else [header(error.status, error.)] end end |