class Groonga::Client::Response::TableList

Public Instance Methods

[](index) click to toggle source
# File lib/groonga/client/response/table-list.rb, line 44
def [](index)
  @tables[index]
end
body=(body) click to toggle source
Calls superclass method
# File lib/groonga/client/response/table-list.rb, line 29
def body=(body)
  super(body)
  parse_body(body)
end
each() { |table| ... } click to toggle source
# File lib/groonga/client/response/table-list.rb, line 34
def each
  @tables.each do |table|
    yield table
  end
end
size() click to toggle source
# File lib/groonga/client/response/table-list.rb, line 40
def size
  @tables.size
end

Private Instance Methods

parse_body(body) click to toggle source
# File lib/groonga/client/response/table-list.rb, line 49
def parse_body(body)
  properties = body.first
  infos = body[1..-1]
  @tables = infos.collect do |info|
    table = Table.new
    properties.each_with_index do |(name, _), i|
      table.send("#{name}=", info[i])
    end
    table
  end
end