Class: SDL::Attribute
- Includes:
- Field::ColumnOptions
- Defined in:
- lib/sdl/attribute.rb
Overview
An attribute of a Model
Instance Attribute Summary collapse
-
#type ⇒ Symbol
readonly
The type of field.
Instance Method Summary collapse
-
#column_name ⇒ Name
The name of the column.
-
#default ⇒ Object
included
from Field::ColumnOptions
A default value for this field.
-
#index? ⇒ Boolean
included
from Field::ColumnOptions
Should this field have an index?.
-
#initialize(name, type, **options) ⇒ Attribute
constructor
private
A new instance of Attribute.
-
#limit ⇒ Integer
included
from Field::ColumnOptions
A limit for the field.
-
#precision ⇒ Integer
included
from Field::ColumnOptions
A precision for the field.
-
#scale ⇒ Integer
included
from Field::ColumnOptions
A scale for the field.
-
#unique? ⇒ Boolean
included
from Field::ColumnOptions
Is this field unique?.
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, **) super(name, **) @type = type end |
Instance Attribute Details
#type ⇒ Symbol (readonly)
The type of field
10 11 12 |
# File 'lib/sdl/attribute.rb', line 10 def type @type end |
Instance Method Details
#column_name ⇒ Name
The name of the column
20 21 22 |
# File 'lib/sdl/attribute.rb', line 20 def column_name name end |
#default ⇒ Object Originally defined in module Field::ColumnOptions
A default value for this field
#index? ⇒ Boolean Originally defined in module Field::ColumnOptions
Should this field have an index?
#limit ⇒ Integer Originally defined in module Field::ColumnOptions
A limit for the field
#precision ⇒ Integer Originally defined in module Field::ColumnOptions
A precision for the field
#scale ⇒ Integer Originally defined in module Field::ColumnOptions
A scale for the field
#unique? ⇒ Boolean Originally defined in module Field::ColumnOptions
Is this field unique?