class Lhm::ColumnWithType

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

Attributes

definition[R]

Public Class Methods

new(name, definition) click to toggle source

Constructor

@param name [String, Symbol] @param definition [Symbol]

# File lib/lhm/column_with_type.rb, line 14
def initialize(name, definition)
  @name = name
  @definition = definition
end

Public Instance Methods

attributes() click to toggle source

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

@return [Array]

# File lib/lhm/column_with_type.rb, line 23
def attributes
  [definition]
end