Class: Rack::Bug::RequestVariablesPanel

Inherits:
Panel
  • Object
show all
Defined in:
lib/rack/bug/panels/request_variables_panel.rb

Instance Attribute Summary

Attributes inherited from Panel

#request

Instance Method Summary collapse

Methods inherited from Panel

#after, #call, #has_content?, #initialize, #panel_app, #render

Methods included from Render

#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params

Constructor Details

This class inherits a constructor from Rack::Bug::Panel

Instance Method Details

#before(env) ⇒ Object



10
11
12
# File 'lib/rack/bug/panels/request_variables_panel.rb', line 10

def before(env)
  @env = env
end

#contentObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rack/bug/panels/request_variables_panel.rb', line 18

def content
  sections = {}
  sections["GET"] = sort(@request.GET) if @request.GET.any?
  sections["POST"] = sort(@request.GET) if @request.POST.any?
  sections["Session"] = sort(@request.env["rack.session"]) if @request.env["rack.session"] && @request.env["rack.session"].any?
  sections["Cookies"] = sort(@request.env["rack.request.cookie_hash"]) if @request.env["rack.request.cookie_hash"] && @request.env["rack.request.cookie_hash"].any?
  server, rack = split_and_filter_env(@env)
  sections["SERVER VARIABLES"] = sort(server)
  sections["Rack ENV"] = sort(rack)
  render_template "panels/request_variables", :sections => sections
end

#headingObject



14
15
16
# File 'lib/rack/bug/panels/request_variables_panel.rb', line 14

def heading
  "Rack Env"
end

#nameObject



6
7
8
# File 'lib/rack/bug/panels/request_variables_panel.rb', line 6

def name
  "request_variables"
end