Class: Lhm::ColumnWithSql

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(name, definition) ⇒ ColumnWithSql

Constructor

Parameters:

  • name (String, Symbol)
  • definition (String)


13
14
15
16
# File 'lib/lhm/column_with_sql.rb', line 13

def initialize(name, definition)
  @name = name
  @definition = definition
end

Instance Method Details

#attributesArray

Returns the column data as an Array to be used with the splat operator. See Lhm::Adaper#add_column

Returns:

  • (Array)


22
23
24
# File 'lib/lhm/column_with_sql.rb', line 22

def attributes
  [type, column_options]
end