class Ducktape::RegexpValidator

Public Class Methods

matches?(obj) click to toggle source
# File lib/ducktape/validators/regexp_validator.rb, line 11
def self.matches?(obj)
  obj.is_a?(Regexp)
end
new(regexp) click to toggle source
# File lib/ducktape/validators/regexp_validator.rb, line 3
def initialize(regexp)
  @regexp = regexp
end

Public Instance Methods

validate(obj) click to toggle source
# File lib/ducktape/validators/regexp_validator.rb, line 7
def validate(obj)
  obj =~ @regexp
end