Sha256: 7b894d6f7a834d477a14f788945d593eb486ba21e4407fcdb7bd9d607ee156ee

Contents?: true

Size: 332 Bytes

Versions: 1

Compression:

Stored size: 332 Bytes

Contents

module SimpleValidate
  class ValidatesNumericalityOf
    attr_reader :message
    attr_accessor :attribute

    def initialize(attribute, options)
      @message = options[:message] || 'must be a number'
      @attribute = attribute
    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-0.1.0 lib/simple_validate/validates_numericality_of.rb