Class: Rack::Bug::Panel
- Inherits:
-
Object
show all
- Includes:
- ERB::Util, Render
- Defined in:
- lib/rack/bug/panel.rb
Overview
Panels are also Rack middleware
Direct Known Subclasses
ActiveRecordPanel, CachePanel, LogPanel, MemoryPanel, RailsInfoPanel, RedisPanel, RequestVariablesPanel, SQLPanel, SphinxPanel, TemplatesPanel, TimerPanel
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Render
#compile, #compile!, #compiled_source, #method_name, #method_name_without_locals, #render_template, #signed_params
Constructor Details
#initialize(app) ⇒ Panel
Returns a new instance of Panel.
13
14
15
16
17
18
19
|
# File 'lib/rack/bug/panel.rb', line 13
def initialize(app)
if panel_app
@app = Rack::Cascade.new([panel_app, app])
else
@app = app
end
end
|
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
11
12
13
|
# File 'lib/rack/bug/panel.rb', line 11
def request
@request
end
|
Instance Method Details
#after(env, status, headers, body) ⇒ Object
41
42
|
# File 'lib/rack/bug/panel.rb', line 41
def after(env, status, , body)
end
|
#before(env) ⇒ Object
38
39
|
# File 'lib/rack/bug/panel.rb', line 38
def before(env)
end
|
#call(env) ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/rack/bug/panel.rb', line 21
def call(env)
before(env)
status, , body = @app.call(env)
@request = Request.new(env)
after(env, status, , body)
env["rack-bug.panels"] << self
return [status, , body]
end
|
#has_content? ⇒ Boolean
34
35
36
|
# File 'lib/rack/bug/panel.rb', line 34
def has_content?
true
end
|
#panel_app ⇒ Object
30
31
32
|
# File 'lib/rack/bug/panel.rb', line 30
def panel_app
nil
end
|
#render(template) ⇒ Object
44
45
|
# File 'lib/rack/bug/panel.rb', line 44
def render(template)
end
|