Class: Droonga::Plugins::Groonga::ColumnCreate::Command

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

Instance Method Summary collapse

Methods inherited from GenericCommand

#execute, #initialize

Constructor Details

This class inherits a constructor from Droonga::Plugins::Groonga::GenericCommand

Instance Method Details

#process_request(request) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/droonga/plugins/groonga/column_create.rb', line 26

def process_request(request)
  command_class = ::Groonga::Command.find("column_create")
  @command = command_class.new("column_create", request)

  table_name = @command["table"]
  if table_name.nil? or @context[table_name].nil?
    message = "table doesn't exist: <#{table_name.to_s}>"
    raise CommandError.new(:status => Status::INVALID_ARGUMENT,
                           :message => message,
                           :result => false)
  end

  if @command.column_index?
    define_index
  else
    define_column
  end
end