Engine: access to url_helpers otside view/controller

I use Engine.
How to get access to url_helpers, such as _path or __url, in
a separate class? In application it simple:

But how to get access to url_helpers in Engine? When I use
Rails.application.routes.url_helpers.root_path, then I get ‘/’, root of
Application. Other helpers for Engine aren’t not defined. Also
Rails.my_engine.routes.url_helpers.root_path fails.