class Hermod::Validators::RegularExpression
Checks the value matches the given regular expression
def initialize(pattern)
def initialize(pattern) @pattern = pattern end
def message
def message "#{value.inspect} does not match #{pattern.inspect}" end
def test
because those are checked by the ValuePresence validator if necessary.
Public: Checks the value matches the pattern. Blank values are ignored
def test value.blank? || value =~ pattern end