Class: Rack::HerokuMeta
- Inherits:
-
Object
- Object
- Rack::HerokuMeta
- Defined in:
- lib/rack/heroku_meta.rb,
lib/rack/heroku_meta/version.rb
Constant Summary collapse
- DEFAULT_ROUTE =
"/heroku_meta"
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ HerokuMeta
constructor
A new instance of HerokuMeta.
Constructor Details
#initialize(app, options = {}) ⇒ HerokuMeta
Returns a new instance of HerokuMeta.
7 8 9 10 |
# File 'lib/rack/heroku_meta.rb', line 7 def initialize(app, = {}) @app = app @route = .fetch(:route, DEFAULT_ROUTE) end |
Instance Method Details
#_call(env) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rack/heroku_meta.rb', line 16 def _call(env) if env["PATH_INFO"] == @route env["REQUEST_METHOD"] == "GET" ? : not_found else @app.call(env) end end |
#call(env) ⇒ Object
12 13 14 |
# File 'lib/rack/heroku_meta.rb', line 12 def call(env) dup._call(env) end |