class PoroValidator::Validators::IntegerValidator
Public Instance Methods
validate(attribute, value, options)
click to toggle source
# File lib/poro_validator/validators/integer_validator.rb, line 4 def validate(attribute, value, options) return if value.nil? if is_numeric?(value.to_s, INTEGER_MATCHER) return nil end message = options[:message] || :integer errors.add(attribute, message) end