Sha256: b444c7186a445c52c69fa074f3305e93e81dbbce59090f6afc1466a2a6a47d35
Contents?: true
Size: 271 Bytes
Versions: 2
Compression:
Stored size: 271 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
simple_validate-1.1.1 | lib/simple_validate/validates_numericality_of.rb |
simple_validate-1.1.0 | lib/simple_validate/validates_numericality_of.rb |