Class: Table
- Inherits:
-
Object
- Object
- Table
- Defined in:
- lib/rails_notebook/table.rb
Overview
This is a table container class, used to display Schema. Author = Tsu-Shiuan Lin
Instance Method Summary collapse
-
#arrowsTo ⇒ Object
Holds a list of the table names corresponding to the foreign keys.
-
#columns ⇒ Object
Holds the column names of the table.
-
#initialize(_table_name, _columns, _arrowsTo) ⇒ Table
constructor
A new instance of Table.
- #printTable ⇒ Object
-
#table_name ⇒ Object
Holds the table name.
Constructor Details
#initialize(_table_name, _columns, _arrowsTo) ⇒ Table
Returns a new instance of Table.
6 7 8 9 10 |
# File 'lib/rails_notebook/table.rb', line 6 def initialize( _table_name, _columns, _arrowsTo ) @table_name = _table_name @columns = _columns @arrowsTo = _arrowsTo end |
Instance Method Details
#arrowsTo ⇒ Object
Holds a list of the table names corresponding to the foreign keys
20 21 22 |
# File 'lib/rails_notebook/table.rb', line 20 def arrowsTo # Holds a list of the table names corresponding to the foreign keys @arrowsTo end |
#columns ⇒ Object
Holds the column names of the table
16 17 18 |
# File 'lib/rails_notebook/table.rb', line 16 def columns # Holds the column names of the table @columns end |
#printTable ⇒ Object
24 25 26 |
# File 'lib/rails_notebook/table.rb', line 24 def printTable puts "Table Name = "+ @table_name.to_s + "\n" + "Columns = " + @columns.to_s + "\n" + "Points to = " + @arrowsTo.to_s + "\n" end |
#table_name ⇒ Object
Holds the table name
12 13 14 |
# File 'lib/rails_notebook/table.rb', line 12 def table_name # Holds the table name @table_name end |