Class: Ridgepole::DSLParser::Context::TableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/ridgepole/dsl_parser.rb

Constant Summary collapse

TYPES =
[
  :string,
  :text,
  :integer,
  :float,
  :decimal,
  :datetime,
  :timestamp,
  :time,
  :date,
  :binary,
  :boolean
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTableDefinition

Returns a new instance of TableDefinition.



6
7
8
# File 'lib/ridgepole/dsl_parser.rb', line 6

def initialize
  @__definition = {}
end

Instance Attribute Details

#__definitionObject (readonly)

Returns the value of attribute __definition.



4
5
6
# File 'lib/ridgepole/dsl_parser.rb', line 4

def __definition
  @__definition
end

Instance Method Details

#column(name, type, options = {}) ⇒ Object



10
11
12
13
14
15
# File 'lib/ridgepole/dsl_parser.rb', line 10

def column(name, type, options = {})
  @__definition[name] = {
    :type => type,
    :options => options,
  }
end