Class: Rack::Gist
- Inherits:
-
Object
- Object
- Rack::Gist
- Defined in:
- lib/rack/gist.rb
Constant Summary collapse
- DefaultCacheTime =
3600
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Gist
constructor
A new instance of Gist.
Constructor Details
#initialize(app, options = {}) ⇒ Gist
Returns a new instance of Gist.
8 9 10 11 |
# File 'lib/rack/gist.rb', line 8 def initialize(app, = {}) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/rack/gist.rb', line 13 def call(env) if path(env).match(regex) serve_gist(env) else status, headers, body = @app.call(env) rewrite(status, headers, body) end end |