Class: Doterd::DSL::Table

Inherits:
BasicObject
Defined in:
lib/doterd.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Table

Returns a new instance of Table.



201
202
203
204
205
206
# File 'lib/doterd.rb', line 201

def initialize(name, &block)
  @name = name
  @columns = {}
  instance_eval &block
  ::Doterd.tables << [@name, @columns]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(col, *options) ⇒ Object



208
209
210
# File 'lib/doterd.rb', line 208

def method_missing(col, *options)
  @columns[col] = options
end