class Typero::FloatType
Public Instance Methods
db_schema()
click to toggle source
# File lib/typero/type/types/float_type.rb, line 18 def db_schema opts = {} opts[:null] = false if opts[:required] [:float, opts] end
set()
click to toggle source
# File lib/typero/type/types/float_type.rb, line 6 def set @value = if opts[:round] value.to_f.round(opts[:round]) else value.to_f end error_for(:min_length_error, opts[:min], value) if opts[:min] && value < opts[:min] error_for(:max_length_error, opts[:max], value) if opts[:max] && value > opts[:max] end