Module: Roda::RodaPlugins::MatchHook

Defined in:
lib/roda/plugins/match_hook.rb

Overview

The match_hook plugin adds hooks that are called upon a successful match by any of the matchers.

plugin :match_hook

match_hook do
  logger.debug("#{request.matched_path} matched. #{request.remaining_path} remaining.")
end

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, RequestMethods

Class Method Summary collapse

Class Method Details

.configure(app) ⇒ Object



15
16
17
# File 'lib/roda/plugins/match_hook.rb', line 15

def self.configure(app)
  app.opts[:match_hooks] ||= []
end