Sha256: 8554ef98979110be08e9316255e90f9bb36c61d4f1e371274fa2b1ff72a3d12d
Contents?: true
Size: 596 Bytes
Versions: 2
Compression:
Stored size: 596 Bytes
Contents
module Jeanine module Callbacks def _callbacks @_callbacks ||= { before: [], after: [], 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 end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jeanine-0.2.0 | lib/jeanine/callbacks.rb |
jeanine-0.1.0 | lib/jeanine/callbacks.rb |