Method: Table#initialize

Defined in:
lib/table.rb

#initialize(table_id, table) ⇒ Table

Returns a new instance of Table.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/table.rb', line 9

def initialize(table_id, table)
  @id = table_id
  @name = table['name'].underscore.singularize
  @entities = []
  @polymorphic = false
  @polymorphic_names = []
  @attributes = []
  table['attributes'].each do |(_attribute_id, attribute)|
    @attributes << Attribute.new(attribute)
  end
  @superclass = nil
  @subclasses = []
end