Class: WraithDB::Column

Inherits:
ActiveRecord::ConnectionAdapters::Column
  • Object
show all
Defined in:
lib/wraithdb/column.rb

Instance Method Summary collapse

Constructor Details

#initialize(column_definition) ⇒ Column

Returns a new instance of Column.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/wraithdb/column.rb', line 3

def initialize(column_definition)
  @name      = column_definition.name
  @sql_type  = nil
  @null      = column_definition.null
  @limit     = column_definition.limit
  @precision = column_definition.precision
  @scale     = column_definition.scale
  @type      = (column_definition.type == :primary_key) ? :integer : column_definition.type.to_sym
  @default   = column_definition.default
  @primary   = column_definition.type == :primary_key
  @coder     = nil
end