Class: Draisine::TypeMapper::ActiveRecordColumnDef

Inherits:
Struct
  • Object
show all
Defined in:
lib/draisine/type_mapper.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#column_nameObject

Returns the value of attribute column_name

Returns:

  • (Object)

    the current value of column_name



5
6
7
# File 'lib/draisine/type_mapper.rb', line 5

def column_name
  @column_name
end

#column_typeObject

Returns the value of attribute column_type

Returns:

  • (Object)

    the current value of column_type



5
6
7
# File 'lib/draisine/type_mapper.rb', line 5

def column_type
  @column_type
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



5
6
7
# File 'lib/draisine/type_mapper.rb', line 5

def options
  @options
end

Class Method Details

.from_ar_column(ar_col) ⇒ Object



6
7
8
# File 'lib/draisine/type_mapper.rb', line 6

def self.from_ar_column(ar_col)
  new(ar_col.name, ar_col.type, { limit: ar_col.limit }.compact)
end