Class: Jets::Router::RouteSet::NamedRouteCollection
- Inherits:
-
Object
- Object
- Jets::Router::RouteSet::NamedRouteCollection
- Defined in:
- lib/jets/router/route_set.rb
Overview
With Jets, this class is not a really a Collection. It’s a wrapper around Helpers::NamedRoutes::Generated which does the real work. Naming it NamedRouteCollection to be consistent with Rails and possibly in the future to make them more similar.
Instance Attribute Summary collapse
-
#url_helpers_module ⇒ Object
readonly
Returns the value of attribute url_helpers_module.
Instance Method Summary collapse
-
#helper_names ⇒ Object
interface method Rails AbstractController::UrlFor calls this method Reason why this wrapper is needed.
-
#initialize(route_set) ⇒ NamedRouteCollection
constructor
A new instance of NamedRouteCollection.
Constructor Details
#initialize(route_set) ⇒ NamedRouteCollection
Returns a new instance of NamedRouteCollection.
36 37 38 |
# File 'lib/jets/router/route_set.rb', line 36 def initialize(route_set) @url_helpers_module = Helpers::NamedRoutes::Generated.create_helper_module(route_set) end |
Instance Attribute Details
#url_helpers_module ⇒ Object (readonly)
Returns the value of attribute url_helpers_module.
35 36 37 |
# File 'lib/jets/router/route_set.rb', line 35 def url_helpers_module @url_helpers_module end |
Instance Method Details
#helper_names ⇒ Object
interface method Rails AbstractController::UrlFor calls this method Reason why this wrapper is needed.
43 44 45 46 |
# File 'lib/jets/router/route_set.rb', line 43 def helper_names url_helpers_module.path_helpers.map(&:to_s) + url_helpers_module.url_helpers.map(&:to_s) end |