Sha256: 3da874d378654800b78b20670a6fcdad4f498399c8307bb131dff418156e3eb1
Contents?: true
Size: 403 Bytes
Versions: 4
Compression:
Stored size: 403 Bytes
Contents
class HashValidator::Validator::BooleanValidator < HashValidator::Validator::Base def initialize super('boolean') # The name of the validator end def validate(key, value, _validations, errors) unless [TrueClass, FalseClass].include?(value.class) errors[key] = presence_error_message end end end HashValidator.append_validator(HashValidator::Validator::BooleanValidator.new)
Version data entries
4 entries across 4 versions & 1 rubygems