Module: Rack::Params::ClassMethods
- Included in:
- Rack
- Defined in:
- lib/rack/params.rb
Instance Method Summary collapse
-
#validator(name, options = {}, &code) ⇒ Object
register a Validator with the given options and block.
Instance Method Details
#validator(name, options = {}, &code) ⇒ Object
register a Validator with the given options and block. the validator can be used in #validate method by providing the name.
34 35 36 |
# File 'lib/rack/params.rb', line 34 def validator(name, = {}, &code) validators[name] = Validator.new(, code) end |