Class: Gifts::UserTable

Inherits:
TableBase show all
Defined in:
lib/gifts/user_table.rb

Instance Method Summary collapse

Methods inherited from TableBase

#initialize

Constructor Details

This class inherits a constructor from Gifts::TableBase

Instance Method Details

#add(name) ⇒ Object



15
16
17
# File 'lib/gifts/user_table.rb', line 15

def add(name)
  db_user = table[name] || table.add(name, name: name)
end

#define_schemaObject



7
8
9
10
11
12
13
# File 'lib/gifts/user_table.rb', line 7

def define_schema
  Groonga::Schema.define do |schema|
    schema.create_table(table_name, type: :hash) do |table|
      table.string("name")
    end
  end
end

#table_nameObject



3
4
5
# File 'lib/gifts/user_table.rb', line 3

def table_name
  "user"
end