Class: Droonga::Plugins::Groonga::GenericCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/plugins/groonga/generic_command.rb

Defined Under Namespace

Classes: CommandError

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ GenericCommand



37
38
39
# File 'lib/droonga/plugins/groonga/generic_command.rb', line 37

def initialize(context)
  @context = context
end

Instance Method Details

#execute(request) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/droonga/plugins/groonga/generic_command.rb', line 41

def execute(request)
  @start_time = Time.now.to_f
  result = process_request(request)
  [header(Status::SUCCESS), result]
rescue CommandError => error
  [header(error.status, error.message), error.result]
end