Exception: ParameterOutOfRangeException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sinatra/params/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#messageObject (readonly)

Returns the value of attribute message.



2
3
4
# File 'lib/sinatra/params/errors.rb', line 2

def message
  @message
end