class Typero::IntegerType

Public Instance Methods

db_schema() click to toggle source
# File lib/typero/type/types/integer_type.rb, line 12
def db_schema
  [:integer, {}]
end
set() click to toggle source
# File lib/typero/type/types/integer_type.rb, line 5
def set
  value(&:to_i)

  error_for(:min_value_error, opts[:min], value) if opts[:min] && value < opts[:min]
  error_for(:max_value_error, opts[:max], value) if opts[:max] && value > opts[:max]
end