Class: GroongaSchema::Schema

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSchema

Returns a new instance of Schema.



26
27
28
29
30
# File 'lib/groonga-schema/schema.rb', line 26

def initialize
  @plugins = []
  @tables = {}
  @columns = {}
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



25
26
27
# File 'lib/groonga-schema/schema.rb', line 25

def columns
  @columns
end

#pluginsObject (readonly)

Returns the value of attribute plugins.



23
24
25
# File 'lib/groonga-schema/schema.rb', line 23

def plugins
  @plugins
end

#tablesObject (readonly)

Returns the value of attribute tables.



24
25
26
# File 'lib/groonga-schema/schema.rb', line 24

def tables
  @tables
end

Instance Method Details

#apply_command(command) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/groonga-schema/schema.rb', line 32

def apply_command(command)
  case command.command_name
  when "register"
    plugin = Plugin.new(command.path)
    @plugins << plugin
  when "plugin_register"
    plugin = Plugin.new(command.name)
    @plugins << plugin
  when "table_create"
    apply_command_table_create(command)
  when "column_create"
    apply_command_column_create(command)
  end
end