module Roda::RodaPlugins::Hooks::InstanceMethods

Private Instance Methods

_route(*, &block) click to toggle source

Before routing, execute the before hooks, and execute the after hooks before returning.

Calls superclass method
# File lib/roda/plugins/hooks.rb, line 90
def _route(*, &block)
  if b = self.class.before
    instance_exec(&b)
  end

  res = super
ensure
  if b = self.class.after
    instance_exec(res, &b)
  end
end