Class: Sinatra::ParamValidator::Parameter

Inherits:
Object
  • Object
show all
Extended by:
Camelize
Defined in:
lib/sinatra/param_validator/parameter.rb,
lib/sinatra/param_validator/parameter/date.rb,
lib/sinatra/param_validator/parameter/hash.rb,
lib/sinatra/param_validator/parameter/time.rb,
lib/sinatra/param_validator/parameter/array.rb,
lib/sinatra/param_validator/parameter/float.rb,
lib/sinatra/param_validator/parameter/common.rb,
lib/sinatra/param_validator/parameter/string.rb,
lib/sinatra/param_validator/parameter/boolean.rb,
lib/sinatra/param_validator/parameter/integer.rb

Overview

Load and validate a single parameter

Defined Under Namespace

Modules: Common, CommonMinMax, CommonMinMaxLength Classes: Array, Boolean, Date, Float, Hash, Integer, String, Time

Class Method Summary collapse

Methods included from Camelize

camelize

Class Method Details

.new(value, type, **args) ⇒ Object



20
21
22
23
24
# File 'lib/sinatra/param_validator/parameter.rb', line 20

def new(value, type, **args)
  type = camelize(type) if type.is_a? Symbol
  klass = Object.const_get "Sinatra::ParamValidator::Parameter::#{type}"
  klass.new(value, **args)
end