Class: Sinatra::ParamValidator::Parameter::String
- Inherits:
-
Object
- Object
- Sinatra::ParamValidator::Parameter::String
- Includes:
- Common, CommonMinMaxLength
- Defined in:
- lib/sinatra/param_validator/parameter/string.rb
Overview
Validation for strings
Instance Attribute Summary
Attributes included from Common
Instance Method Summary collapse
Methods included from CommonMinMaxLength
Methods included from Common
#in, #initialize, #is, #nillable, #required, #valid?
Instance Method Details
#format(format_string) ⇒ Object
13 14 15 |
# File 'lib/sinatra/param_validator/parameter/string.rb', line 13 def format(format_string) @errors.push "Parameter must match the format #{format_string}" unless @coerced&.match?(format_string) end |