class Groonga::Client::Command

Public Class Methods

new(command) click to toggle source
# File lib/groonga/client/command.rb, line 25
def initialize(command)
  @command = command
end

Public Instance Methods

execute(connection) { |response| ... } click to toggle source
# File lib/groonga/client/command.rb, line 29
def execute(connection)
  async = block_given?

  response = nil
  request = connection.send(@command) do |raw_response|
    response = parse_raw_response(raw_response)
    yield(response) if async
  end

  if async
    request
  else
    request.wait
    response
  end
end

Private Instance Methods

parse_raw_response(raw_response) click to toggle source
# File lib/groonga/client/command.rb, line 47
def parse_raw_response(raw_response)
  Groonga::Client::Response.parse(@command, raw_response)
end