Class: Hanami::Providers::Routes Private
- Inherits:
-
Dry::System::Provider::Source
- Object
- Dry::System::Provider::Source
- Hanami::Providers::Routes
- Defined in:
- lib/hanami/providers/routes.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.
Provider source to register routes helper component in Hanami slices.
Class Method Summary collapse
- .for_slice(slice) ⇒ Object private
- .slice ⇒ Object private
Instance Method Summary collapse
- #prepare ⇒ Object private
- #start ⇒ Object private
Class Method Details
.for_slice(slice) ⇒ 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.
14 15 16 17 18 |
# File 'lib/hanami/providers/routes.rb', line 14 def self.for_slice(slice) Class.new(self) do |klass| klass.instance_variable_set(:@slice, slice) end end |
Instance Method Details
#prepare ⇒ 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.
26 27 28 |
# File 'lib/hanami/providers/routes.rb', line 26 def prepare require "hanami/slice/routes_helper" end |
#start ⇒ 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.
31 32 33 34 35 36 37 38 |
# File 'lib/hanami/providers/routes.rb', line 31 def start # Register a lazy instance of RoutesHelper to ensure we don't load prematurely load the # router during the process of booting. This ensures the router's resolver can run strict # action key checks once when it runs on a fully booted slice. register :routes do Hanami::Slice::RoutesHelper.new(self.class.slice.router) end end |