class Sinatra::Chiro::Parameters::RegexpValidator

Public Instance Methods

comment() click to toggle source
# File lib/sinatra/chiro/parameters/regexp.rb, line 14
def comment
  "#{options[:comment]}"
end
type_description() click to toggle source
# File lib/sinatra/chiro/parameters/regexp.rb, line 10
def type_description
  super || "Regexp"
end
validate(given) click to toggle source
# File lib/sinatra/chiro/parameters/regexp.rb, line 6
def validate(given)
  "#{name_display} parameter should match regexp: #{options[:type]}" if given[name] !~ options[:type]
end