Class: SDL::Enum
- Includes:
- Field::ColumnOptions
- Defined in:
- lib/sdl/enum.rb
Overview
A field of a Model that has a predefined list of possible values
Instance Method Summary collapse
-
#column_name ⇒ Name
The name of the column.
-
#default ⇒ Name
A default value for this field.
-
#index? ⇒ Boolean
included
from Field::ColumnOptions
Should this field have an index?.
-
#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.
-
#type ⇒ Symbol
The type of field.
-
#unique? ⇒ Boolean
included
from Field::ColumnOptions
Is this field unique?.
-
#values ⇒ Array<Name>
The possible values for the enum.
Constructor Details
This class inherits a constructor from SDL::Field
Instance Method Details
#column_name ⇒ Name
The name of the column
29 30 31 |
# File 'lib/sdl/enum.rb', line 29 def column_name name end |
#default ⇒ Name
A default value for this field
17 18 19 |
# File 'lib/sdl/enum.rb', line 17 def default Name.new([:default].to_s) if [:default] end |
#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
#type ⇒ Symbol
The type of field
11 12 13 |
# File 'lib/sdl/enum.rb', line 11 def type :enum end |
#unique? ⇒ Boolean Originally defined in module Field::ColumnOptions
Is this field unique?