Class: Table

Inherits:
Object
  • Object
show all
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

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

#arrowsToObject

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

#columnsObject

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

#printTableObject



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_nameObject

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