Class: SQL::TableCreator::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter, name, type, opts = {}) ⇒ Column

Returns a new instance of Column.



51
52
53
54
55
56
# File 'lib/dm-migrations/sql/table_creator.rb', line 51

def initialize(adapter, name, type, opts = {})
  @adapter = adapter
  @name = name.to_s
  @opts = opts
  @type = build_type(type)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



49
50
51
# File 'lib/dm-migrations/sql/table_creator.rb', line 49

def name
  @name
end

#typeObject

Returns the value of attribute type.



49
50
51
# File 'lib/dm-migrations/sql/table_creator.rb', line 49

def type
  @type
end

Instance Method Details

#to_sqlObject



58
59
60
# File 'lib/dm-migrations/sql/table_creator.rb', line 58

def to_sql
  type
end