Class: Hanami::Routing::Route Private
- Inherits:
-
HttpRouter::Route
- Object
- HttpRouter::Route
- Hanami::Routing::Route
- Defined in:
- lib/hanami/routing/route.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Entry of the routing system
Instance Method Summary collapse
-
#generate(resolver, options = {}, &endpoint) ⇒ Object
private
Asks the given resolver to return an endpoint that will be associated with the other options.
-
#initialize ⇒ Route
constructor
private
A new instance of Route.
-
#nested_router ⇒ Object
private
Introspect the given route to understand if there is a wrapped router that has an inspector.
Constructor Details
#initialize ⇒ Route
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.
Returns a new instance of Route.
22 23 24 25 |
# File 'lib/hanami/routing/route.rb', line 22 def initialize(*) super @name = nil end |
Instance Method Details
#generate(resolver, options = {}, &endpoint) ⇒ 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.
Asks the given resolver to return an endpoint that will be associated
with the other options.
49 50 51 52 53 |
# File 'lib/hanami/routing/route.rb', line 49 def generate(resolver, = {}, &endpoint) self.to = resolver.resolve(, &endpoint) self.name = [:as].to_sym if [:as] self end |
#nested_router ⇒ 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.
Introspect the given route to understand if there is a wrapped router that has an inspector
60 61 62 |
# File 'lib/hanami/routing/route.rb', line 60 def nested_router dest.routes if dest.respond_to?(:routes) && dest.routes.respond_to?(:inspector) end |