Class: RouteDog::Middleware::Notifier

Inherits:
RouteDog
  • Object
show all
Defined in:
lib/route_dog/middleware/notifier.rb

Instance Method Summary collapse

Methods included from RouteDog

action_string_for_route, config_file, constantize_controller_str, delete_watched_routes_file, load_watched_routes, route_tested?, route_tested_with_requirements?, watched_routes_file, write_watched_routes

Constructor Details

#initialize(app) ⇒ Notifier

Returns a new instance of Notifier.



4
5
6
# File 'lib/route_dog/middleware/notifier.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/route_dog/middleware/notifier.rb', line 8

def call(env)
  @env = env

  @status, @headers, @response = @app.call(env)

  if is_html_response? && !tested_action?
    append_warning
  end

  [@status, @headers, @response]
end