Class: GroongaClientModel::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga_client_model/schema.rb

Defined Under Namespace

Classes: Columns, Table, Tables

Instance Method Summary collapse

Constructor Details

#initializeSchema

Returns a new instance of Schema.



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/groonga_client_model/schema.rb', line 19

def initialize
  @raw = GroongaClientModel::Client.open do |client|
    response = client.schema
    unless response.success?
      message = "failed to retrieve schema: "
      message << "#{response.return_code}:#{response.error_message}"
      raise Error, message
    end
    response
  end
end

Instance Method Details

#tablesObject



31
32
33
# File 'lib/groonga_client_model/schema.rb', line 31

def tables
  Tables.new(@raw, @raw.tables)
end