Class: Rack::Reloader
- Inherits:
-
Object
- Object
- Rack::Reloader
- Defined in:
- lib/rack/reloader.rb
Defined Under Namespace
Classes: Config
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) {|@config| ... } ⇒ Reloader
constructor
A new instance of Reloader.
Constructor Details
#initialize(app) {|@config| ... } ⇒ Reloader
Returns a new instance of Reloader.
12 13 14 15 16 17 |
# File 'lib/rack/reloader.rb', line 12 def initialize(app) @app = app @config = Config.new @mark = rand(Time.now.to_i) yield(@config) if block_given? end |
Instance Method Details
#call(env) ⇒ Object
19 20 21 22 |
# File 'lib/rack/reloader.rb', line 19 def call(env) status, headers, body = @app.call(env) [status, headers, inject_script(body)] end |