Sha256: 15b84905c7248ba8aedb95b1dd483f1757f80191a2e5d3d62083bc754310ce83
Contents?: true
Size: 272 Bytes
Versions: 1
Compression:
Stored size: 272 Bytes
Contents
module SimpleValidate class ValidatesNumericalityOf < ValidatesBase def initialize(attribute, options) super(attribute, options[:message] || "must be a number") end def valid?(instance) instance.send(attribute).is_a?(Numeric) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simple_validate-1.0.0 | lib/simple_validate/validates_numericality_of.rb |