Module: Groonga::Client::Response

Defined in:
lib/groonga/client/response/base.rb,
lib/groonga/client/response/dump.rb,
lib/groonga/client/response/load.rb,
lib/groonga/client/response/quit.rb,
lib/groonga/client/response/check.rb,
lib/groonga/client/response/error.rb,
lib/groonga/client/response/defrag.rb,
lib/groonga/client/response/delete.rb,
lib/groonga/client/response/schema.rb,
lib/groonga/client/response/select.rb,
lib/groonga/client/response/status.rb,
lib/groonga/client/response/log-put.rb,
lib/groonga/client/response/register.rb,
lib/groonga/client/response/log-level.rb,
lib/groonga/client/response/lock-clear.rb,
lib/groonga/client/response/log-reopen.rb,
lib/groonga/client/response/table-list.rb,
lib/groonga/client/response/cache-limit.rb,
lib/groonga/client/response/column-list.rb,
lib/groonga/client/response/table-create.rb,
lib/groonga/client/response/table-remove.rb,
lib/groonga/client/response/column-create.rb,
lib/groonga/client/response/column-remove.rb,
lib/groonga/client/response/column-rename.rb

Defined Under Namespace

Classes: Base, CacheLimit, Check, ColumnCreate, ColumnList, ColumnRemove, ColumnRename, Defrag, Delete, Dump, Error, Load, LockClear, LogLevel, LogPut, LogReopen, Quit, Register, Schema, Select, Status, TableCreate, TableList, TableRemove

Constant Summary collapse

@@registered_commands =
{}

Class Method Summary collapse

Class Method Details

.find(name) ⇒ Object


34
35
36
# File 'lib/groonga/client/response/base.rb', line 34

def find(name)
  @@registered_commands[normalize_name(name)] || Base
end

.parse(command, raw_response) ⇒ Base

Parses the response for the request of the command and returns response object.

Parameters:

  • command (Groonga::Command::Base)

    The command of the request.

  • raw_response (String)

    The raw (not parsed) response returned by Groonga server.

Returns:


47
48
49
50
# File 'lib/groonga/client/response/base.rb', line 47

def parse(command, raw_response)
  klass = find(command.command_name)
  klass.parse(command, raw_response)
end

.register(name, klass) ⇒ Object


30
31
32
# File 'lib/groonga/client/response/base.rb', line 30

def register(name, klass)
  @@registered_commands[normalize_name(name)] = klass
end