Class: CodeBuddy::ShowApp
- Inherits:
-
Object
- Object
- CodeBuddy::ShowApp
- Defined in:
- lib/code_buddy/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ShowApp
constructor
A new instance of ShowApp.
Constructor Details
#initialize(app) ⇒ ShowApp
Returns a new instance of ShowApp.
3 4 5 |
# File 'lib/code_buddy/middleware.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/code_buddy/middleware.rb', line 7 def call(env) if env['PATH_INFO'] =~ /^\/code_buddy(.*)/ #&& Rails.env.development? env['PATH_INFO'] = $1 App.new.call(env) else @app.call(env) end end |