Sha256: 24ed3fab29ec8b3869bfee09b0e263565dcaec855273be40c61353eda71cdf3e

Contents?: true

Size: 333 Bytes

Versions: 10

Compression:

Stored size: 333 Bytes

Contents

require 'hermod/validators/base'

module Hermod
  module Validators
    # checks the value is present
    class ValuePresence < Base

      private

      def test(value, attributes)
        value.present?
      end

      def message(value, attributes)
        "isn't optional but no value was provided"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hermod-3.3.0 lib/hermod/validators/value_presence.rb
hermod-3.2.0 lib/hermod/validators/value_presence.rb
hermod-3.0.0 lib/hermod/validators/value_presence.rb
hermod-2.7.0 lib/hermod/validators/value_presence.rb
hermod-2.7.0.pre.rc.1 lib/hermod/validators/value_presence.rb
hermod-2.6.2 lib/hermod/validators/value_presence.rb
hermod-2.6.1 lib/hermod/validators/value_presence.rb
hermod-2.5.3 lib/hermod/validators/value_presence.rb
hermod-2.5.2 lib/hermod/validators/value_presence.rb
hermod-2.5.1 lib/hermod/validators/value_presence.rb