Class: SQL::Table

Inherits:
Object show all
Defined in:
lib/gems/dm-migrations-0.9.9/lib/sql/table.rb

Direct Known Subclasses

Postgresql::Table, Sqlite3::Table

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



7
8
9
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/table.rb', line 7

def columns
  @columns
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/table.rb', line 7

def name
  @name
end

Instance Method Details

#column(column_name) ⇒ Object



13
14
15
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/table.rb', line 13

def column(column_name)
  @columns.select { |c| c.name == column_name.to_s }.first
end

#to_sObject



9
10
11
# File 'lib/gems/dm-migrations-0.9.9/lib/sql/table.rb', line 9

def to_s
  name
end