lib/roda/plugins/hooks.rb in roda-1.3.0 vs lib/roda/plugins/hooks.rb in roda-2.0.0

- old
+ new

@@ -65,14 +65,12 @@ end end end module InstanceMethods - private - # Before routing, execute the before hooks, and # execute the after hooks before returning. - def _route(*, &block) + def call if b = opts[:before_hook] instance_exec(&b) end res = super