Class: Droonga::GroongaHandler::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/plugin/handler/groonga.rb

Direct Known Subclasses

ColumnCreate, TableCreate

Defined Under Namespace

Classes: CommandError

Instance Method Summary collapse

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.message), error.result]
end