Class: Lhm::ColumnWithSql
- Inherits:
-
Object
- Object
- Lhm::ColumnWithSql
- Extended by:
- Forwardable
- Defined in:
- lib/lhm/column_with_sql.rb
Overview
Abstracts the details of a table column definition when specified with a MySQL column definition string
Class Method Summary collapse
-
.column_factory ⇒ Constant
Returns the column’s class to be used.
Instance Method Summary collapse
-
#attributes ⇒ Array
Returns the column data as an Array to be used with the splat operator.
-
#initialize(name, definition) ⇒ ColumnWithSql
constructor
Constructor.
Constructor Details
#initialize(name, definition) ⇒ ColumnWithSql
Constructor
21 22 23 24 |
# File 'lib/lhm/column_with_sql.rb', line 21 def initialize(name, definition) @name = name @definition = definition end |
Class Method Details
.column_factory ⇒ Constant
Returns the column’s class to be used
13 14 15 |
# File 'lib/lhm/column_with_sql.rb', line 13 def self.column_factory ::ActiveRecord::ConnectionAdapters::PerconaMigratorAdapter::Column end |
Instance Method Details
#attributes ⇒ Array
Returns the column data as an Array to be used with the splat operator. See Lhm::Adaper#add_column
30 31 32 |
# File 'lib/lhm/column_with_sql.rb', line 30 def attributes [type, ] end |