class GreenMonster::Schema

Attributes

attributes[R]
index_key[R]

Public Class Methods

new() click to toggle source
# File lib/green_monster/schema.rb, line 5
def initialize()
end

Public Instance Methods

attribute(name, type, options = {}) click to toggle source
# File lib/green_monster/schema.rb, line 8
def attribute(name, type, options = {})
  @attributes    ||= []
  @column_number ||= 0

  if options[:col_num].present?
    @column_number = options[:col_num]
  else
    options.update(col_num: @column_number)
  end
  @column_number += 1

  @attributes << type.new(name, options)
end
key(key) click to toggle source
# File lib/green_monster/schema.rb, line 22
def key(key)
  @index_key = key
end