Exception: ParameterOutOfRangeException
- Inherits:
-
StandardError
- Object
- StandardError
- ParameterOutOfRangeException
- Defined in:
- lib/sinatra/params/errors.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(name, type) ⇒ ParameterOutOfRangeException
constructor
A new instance of ParameterOutOfRangeException.
Constructor Details
#initialize(name, type) ⇒ ParameterOutOfRangeException
Returns a new instance of ParameterOutOfRangeException.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/sinatra/params/errors.rb', line 4 def initialize(name, type) case type when :min @message = "Parameter `#{name}` is less than the minimum permitted" when :max @message = "Parameter `#{name}` is more than the maximum permitted" when :in @message = "Parameter `#{name}` is not in the list of possible values" end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
2 3 4 |
# File 'lib/sinatra/params/errors.rb', line 2 def @message end |