Class: Rack::Utils::Context
- Inherits:
-
Proc
- Object
- Proc
- Rack::Utils::Context
- Defined in:
- lib/rack/utils.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#for ⇒ Object
readonly
Returns the value of attribute for.
Instance Method Summary collapse
-
#initialize(app_f = nil, app_r = nil) ⇒ Context
constructor
A new instance of Context.
- #inspect ⇒ Object
- #old_inspect ⇒ Object
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(app_f = nil, app_r = nil) ⇒ Context
Returns a new instance of Context.
76 77 78 |
# File 'lib/rack/utils.rb', line 76 def initialize app_f=nil, app_r=nil @for, @app = app_f, app_r end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
75 76 77 |
# File 'lib/rack/utils.rb', line 75 def app @app end |
#for ⇒ Object (readonly)
Returns the value of attribute for.
75 76 77 |
# File 'lib/rack/utils.rb', line 75 def for @for end |
Instance Method Details
#inspect ⇒ Object
80 81 82 |
# File 'lib/rack/utils.rb', line 80 def inspect "#{old_inspect} ==> #{@for.inspect} ==> #{@app.inspect}" end |
#old_inspect ⇒ Object
79 |
# File 'lib/rack/utils.rb', line 79 alias_method :old_inspect, :inspect |
#pretty_print(pp) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/rack/utils.rb', line 83 def pretty_print pp pp.text old_inspect pp.nest 1 do pp.breakable pp.text '=for> ' pp.pp @for pp.breakable pp.text '=app> ' pp.pp @app end end |