Module: SDL::Field::ColumnOptions

Included in:
Association::BelongsTo, Attribute, Enum
Defined in:
lib/sdl/field.rb

Instance Method Summary collapse

Instance Method Details

#defaultObject

A default value for this field

Returns:

  • (Object)

123
124
125
# File 'lib/sdl/field.rb', line 123

def default
  options[:default]
end

#index?Boolean

Should this field have an index?

Returns:

  • (Boolean)

153
154
155
# File 'lib/sdl/field.rb', line 153

def index?
  options.fetch(:index, false)
end

#limitInteger

A limit for the field

Returns:

  • (Integer)

129
130
131
# File 'lib/sdl/field.rb', line 129

def limit
  options[:limit]
end

#precisionInteger

A precision for the field

Returns:

  • (Integer)

135
136
137
# File 'lib/sdl/field.rb', line 135

def precision
  options[:precision]
end

#scaleInteger

A scale for the field

Returns:

  • (Integer)

141
142
143
# File 'lib/sdl/field.rb', line 141

def scale
  options[:scale]
end

#unique?Boolean

Is this field unique?

Returns:

  • (Boolean)

147
148
149
# File 'lib/sdl/field.rb', line 147

def unique?
  options.fetch(:unique, false)
end