Module: Crystal::Filters::ClassMethods

Defined in:
lib/crystal/support/filters.rb

Instance Method Summary collapse

Instance Method Details

#after(*args, &block) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/crystal/support/filters.rb', line 24

def after *args, &block
  opt = args.extract_options!
  if block       
    set_callback :action, :after, opt, &block
  else 
    args.each{|executor| set_callback :action, :after, executor, opt}        
  end
end

#around(*args, &block) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/crystal/support/filters.rb', line 15

def around *args, &block
  opt = args.extract_options!
  if block       
    set_callback :action, :around, opt, &block
  else 
    args.each{|executor| set_callback :action, :around, executor, opt}        
  end
end

#before(*args, &block) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/crystal/support/filters.rb', line 6

def before *args, &block
  opt = args.extract_options!
  if block       
    set_callback :action, :before, opt, &block
  else 
    args.each{|executor| set_callback :action, :before, executor, opt}        
  end
end