Class: Lhm::ColumnWithType
- Inherits:
-
Object
- Object
- Lhm::ColumnWithType
- Defined in:
- lib/lhm/column_with_type.rb
Overview
Abstracts the details of a table column definition when specified with a type as a symbol. This is the regular ActiveRecord’s #add_column syntax:
add_column :tablenames, :field, :string
Instance Method Summary collapse
-
#attributes ⇒ Array
Returns the column data as an Array to be used with the splat operator.
-
#initialize(name, definition) ⇒ ColumnWithType
constructor
Constructor.
Constructor Details
#initialize(name, definition) ⇒ ColumnWithType
Constructor
12 13 14 15 |
# File 'lib/lhm/column_with_type.rb', line 12 def initialize(name, definition) @name = name @definition = definition 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
21 22 23 |
# File 'lib/lhm/column_with_type.rb', line 21 def attributes [definition] end |