Class: Wallaby::EngineNameFinder
- Inherits:
-
Object
- Object
- Wallaby::EngineNameFinder
- Defined in:
- lib/services/wallaby/engine_name_finder.rb
Overview
Find out the engine routing proxy name
Class Method Summary collapse
-
.execute(request_path) ⇒ String
Go through all the routes and find out the engine routing proxy name for the given request path.
Class Method Details
.execute(request_path) ⇒ String
Go through all the routes and find out the engine routing proxy name for the given request path.
When it can’t find the engine name, it will return empty string to prevent it from being run again.
15 16 17 18 19 20 21 22 |
# File 'lib/services/wallaby/engine_name_finder.rb', line 15 def execute(request_path) named_routes = Rails.application.routes.routes.find do |route| route.path.match(request_path) && route.app.app == Wallaby::Engine end named_routes.try(:name) || EMPTY_STRING end |