Class: MysqlFramework::SqlTable

Inherits:
Object
  • Object
show all
Defined in:
lib/mysql_framework/sql_table.rb

Overview

This class is used to represent a sql table

Instance Method Summary collapse

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_sObject



15
16
17
# File 'lib/mysql_framework/sql_table.rb', line 15

def to_s
  "`#{@name}`"
end

#to_symObject



19
20
21
# File 'lib/mysql_framework/sql_table.rb', line 19

def to_sym
  @name.to_sym
end