# File lib/rbot/config.rb, line 104 def validate(val, validator = @validate) case validator when false, nil return true when Proc return validator.call(val) when Regexp raise ArgumentError, "validation via Regexp only supported for strings!" unless String === val return validator.match(val) else raise ArgumentError, "validation type #{validator.class} not supported" end end