Module: Hanami::Helpers::RoutingHelper
- Defined in:
- lib/hanami/helpers/routing_helper.rb
Overview
Routing helper for full stack Hanami web applications.
For a given application called Web::Application
, at runtime Hanami creates a routes factory called Web.routes
.
By including this module in a view, it makes that factory avaliable as routes
.
Class Method Summary collapse
- .included(base) ⇒ Object private
Class Method Details
.included(base) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 48 49 50 51 52 53 |
# File 'lib/hanami/helpers/routing_helper.rb', line 45 def self.included(base) factory = "#{Utils::String.namespace(base)}.routes" base.class_eval <<-END_EVAL, __FILE__, __LINE__ + 1 def routes #{factory} end END_EVAL end |