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
14 15 16 17 |
# File 'lib/lhm/column_with_type.rb', line 14 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
23 24 25 |
# File 'lib/lhm/column_with_type.rb', line 23 def attributes [definition] end |