lib/jeanine/callbacks.rb in jeanine-0.2.0 vs lib/jeanine/callbacks.rb in jeanine-0.3.0

- old
+ new

@@ -7,22 +7,23 @@ before_all: [], after_all: [] } end - def _register_callback(type, paths = [], &block) - if paths == [] - _callbacks["#{type}_all".to_sym] << { block: block } - else - _callbacks[type] << { paths: paths, block: block } - end - end - def before(*paths, &block) _register_callback(:before, paths, &block) end def after(*paths, &block) _register_callback(:after, paths, &block) + end + + private + def _register_callback(type, paths = [], &block) + if paths == [] + _callbacks["#{type}_all".to_sym] << { block: block } + else + _callbacks[type] << { paths: paths, block: block } + end end end end