class Hanami::Providers::Routes

Provider source to register routes helper component in Hanami slices.

@see Hanami::Slice::RoutesHelper

@api private @since 2.0.0

Public Instance Methods

prepare() click to toggle source

@api private

# File lib/hanami/providers/routes.rb, line 14
def prepare
  require "hanami/slice/routes_helper"
end
start() click to toggle source

@api private

# File lib/hanami/providers/routes.rb, line 19
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(slice.router)
  end
end