Class: Pryx::PryHackForRodaRailsMiddleware
- Defined in:
- lib/pryx/pry_hack.rb
Overview
Hack for roda/rails, 在每一次发送请求之前,总是设定 ENV to nil. 这可以确保,pry! 总是会被拦截,但是仅仅只会被拦截一次。
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ PryHackForRodaRailsMiddleware
constructor
A new instance of PryHackForRodaRailsMiddleware.
Constructor Details
#initialize(app) ⇒ PryHackForRodaRailsMiddleware
Returns a new instance of PryHackForRodaRailsMiddleware.
87 88 89 |
# File 'lib/pryx/pry_hack.rb', line 87 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
85 86 87 |
# File 'lib/pryx/pry_hack.rb', line 85 def app @app end |
Instance Method Details
#call(env) ⇒ Object
91 92 93 94 |
# File 'lib/pryx/pry_hack.rb', line 91 def call(env) ENV['Pry_was_started'] = nil @app.call(env) end |