# File lib/rbot/config.rb, line 87 def validate(value) return true unless @validate if @validate.instance_of?(Proc) return @validate.call(value) elsif @validate.instance_of?(Regexp) raise ArgumentError, "validation via Regexp only supported for strings!" unless value.instance_of? String return @validate.match(value) else raise ArgumentError, "validation type #{@validate.class} not supported" end end