Sha256: 9c7fdc7e8588ff64211305c85a6fbf78cde2e0835930db0349055a8410aff702

Contents?: true

Size: 290 Bytes

Versions: 8

Compression:

Stored size: 290 Bytes

Contents

module Compel
  module Validation

    class Max < Condition

      def validate_value
        unless valid?
          "cannot be greater than #{option_value}"
        end
      end

      private

      def valid?
        !value.nil? && value <= option_value
      end

    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
compel-0.5.1 lib/compel/validation/conditions/max.rb
compel-0.5.0 lib/compel/validation/conditions/max.rb
compel-0.4.3 lib/compel/validation/conditions/max.rb
compel-0.4.2 lib/compel/validation/conditions/max.rb
compel-0.4.0 lib/compel/validation/conditions/max.rb
compel-0.3.7 lib/compel/validation/conditions/max.rb
compel-0.3.6 lib/compel/validation/conditions/max.rb
compel-0.3.4 lib/compel/validation/conditions/max.rb