Class: SDL::Attribute

Inherits:
Field
  • Object
show all
Includes:
Field::ColumnOptions
Defined in:
lib/sdl/attribute.rb

Overview

An attribute of a Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, **options) ⇒ Attribute

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Attribute.


13
14
15
16
# File 'lib/sdl/attribute.rb', line 13

def initialize(name, type, **options)
  super(name, **options)
  @type = type
end

Instance Attribute Details

#typeSymbol (readonly)

The type of field

Returns:

  • (Symbol)

10
11
12
# File 'lib/sdl/attribute.rb', line 10

def type
  @type
end

Instance Method Details

#column_nameName

The name of the column

Returns:


20
21
22
# File 'lib/sdl/attribute.rb', line 20

def column_name
  name
end

#defaultObject Originally defined in module Field::ColumnOptions

A default value for this field

Returns:

  • (Object)

#index?Boolean Originally defined in module Field::ColumnOptions

Should this field have an index?

Returns:

  • (Boolean)

#limitInteger Originally defined in module Field::ColumnOptions

A limit for the field

Returns:

  • (Integer)

#precisionInteger Originally defined in module Field::ColumnOptions

A precision for the field

Returns:

  • (Integer)

#scaleInteger Originally defined in module Field::ColumnOptions

A scale for the field

Returns:

  • (Integer)

#unique?Boolean Originally defined in module Field::ColumnOptions

Is this field unique?

Returns:

  • (Boolean)