Module: Sinatra::ParamsHandler

Defined in:
lib/sinatra/handlers/params.rb

Instance Method Summary collapse

Instance Method Details

#enable_paramsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sinatra/handlers/params.rb', line 5

def enable_params
  p "Enabling params handler..."

  before "*" do
    unless params.nil?
      tmp = {}
      for key in params.keys
        value = params[key]
        value = value.join(",").split(",") if value.respond_to? :join
        tmp[key.to_sym] =  value
      end
      @params.clear
      @params = tmp
    end
  end

end