Class: MysqlFramework::SqlTable
- Inherits:
-
Object
- Object
- MysqlFramework::SqlTable
- Defined in:
- lib/mysql_framework/sql_table.rb
Overview
This class is used to represent a sql table
Instance Method Summary collapse
-
#[](column) ⇒ Object
This method is called to get a sql column for this table.
-
#initialize(name) ⇒ SqlTable
constructor
A new instance of SqlTable.
- #to_s ⇒ Object
- #to_sym ⇒ Object
Constructor Details
#initialize(name) ⇒ SqlTable
Returns a new instance of SqlTable.
6 7 8 |
# File 'lib/mysql_framework/sql_table.rb', line 6 def initialize(name) @name = name end |
Instance Method Details
#[](column) ⇒ Object
This method is called to get a sql column for this table
11 12 13 |
# File 'lib/mysql_framework/sql_table.rb', line 11 def [](column) SqlColumn.new(table: @name, column: column) end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/mysql_framework/sql_table.rb', line 15 def to_s "`#{@name}`" end |
#to_sym ⇒ Object
19 20 21 |
# File 'lib/mysql_framework/sql_table.rb', line 19 def to_sym @name.to_sym end |