Class: ActiveWorkbench::Schema
- Inherits:
-
Object
- Object
- ActiveWorkbench::Schema
- Defined in:
- lib/active_workbench/base.rb
Instance Method Summary collapse
- #add_table(id, name) ⇒ Object
- #generate ⇒ Object
- #table_by_id(id) ⇒ Object
- #table_by_name(name) ⇒ Object
- #tables ⇒ Object
Instance Method Details
#add_table(id, name) ⇒ Object
10 11 12 13 14 |
# File 'lib/active_workbench/base.rb', line 10 def add_table id, name @tables_ids ||= {} @tables_names ||= {} @tables_ids[id] = @tables_names[name] = Table.new(self, id, name) end |
#generate ⇒ Object
28 29 30 |
# File 'lib/active_workbench/base.rb', line 28 def generate end |
#table_by_id(id) ⇒ Object
20 21 22 |
# File 'lib/active_workbench/base.rb', line 20 def table_by_id id @tables_ids[id] end |
#table_by_name(name) ⇒ Object
24 25 26 |
# File 'lib/active_workbench/base.rb', line 24 def table_by_name name @tables_names[name] end |
#tables ⇒ Object
16 17 18 |
# File 'lib/active_workbench/base.rb', line 16 def tables @tables_ids.values end |