Sha256: 4838fd882c5d2ccd1a4f576372d92c5f409bbfad4a5ced086c8f8c29476d5c65
Contents?: true
Size: 555 Bytes
Versions: 10
Compression:
Stored size: 555 Bytes
Contents
class HashValidator::Validator::Base attr_accessor :name def initialize(name) unless name.is_a?(String) && name.size > 0 raise StandardError.new('Validator must be initialized with a valid name (string with length greater than zero)') end self.name = name end def should_validate?(name) self.name == name end def presence_error_message "#{self.name} required" end def validate(key, value, validations, errors) raise StandardError.new('validate should not be called directly on BaseValidator') end end
Version data entries
10 entries across 10 versions & 1 rubygems