Module: Laminar::Callbacks::ClassMethods

Defined in:
lib/laminar/callbacks.rb

Overview

Class methods and attributes.

Instance Method Summary collapse

Instance Method Details

#after(*args, &block) ⇒ Object Also known as: after_call



21
22
23
24
# File 'lib/laminar/callbacks.rb', line 21

def after(*args, &block)
  after_list.concat(args)
  after_list << block if block
end

#after_listObject



36
37
38
# File 'lib/laminar/callbacks.rb', line 36

def after_list
  @after_list ||= []
end

#before(*args, &block) ⇒ Object Also known as: before_call



15
16
17
18
# File 'lib/laminar/callbacks.rb', line 15

def before(*args, &block)
  before_list.concat(args)
  before_list << block if block
end

#before_listObject



32
33
34
# File 'lib/laminar/callbacks.rb', line 32

def before_list
  @before_list ||= []
end

#final_listObject



40
41
42
# File 'lib/laminar/callbacks.rb', line 40

def final_list
  @final_list ||= []
end

#finalize(*args, &block) ⇒ Object



27
28
29
30
# File 'lib/laminar/callbacks.rb', line 27

def finalize(*args, &block)
  final_list.concat(args)
  final_list << block if block
end