Class: SQL::Table

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

Direct Known Subclasses

Postgres::Table, Sqlite::Table

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



5
6
7
# File 'lib/dm-migrations/sql/table.rb', line 5

def columns
  @columns
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/dm-migrations/sql/table.rb', line 5

def name
  @name
end

Instance Method Details

#column(column_name) ⇒ Object



11
12
13
# File 'lib/dm-migrations/sql/table.rb', line 11

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

#to_sObject



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

def to_s
  name
end