Module: Rlyeh::Filters

Defined in:
lib/rlyeh/filters.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/rlyeh/filters.rb', line 5

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#run_filters(name, *args, &block) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/rlyeh/filters.rb', line 25

def run_filters(name, *args, &block)
  catch :halt do
    _run_filters name, [:before, :arround], *args
    result = block.call *args if block
    _run_filters name, [:arround, :after], *args
    result
  end
end