Module: ActiveEncode::Callbacks::ClassMethods

Defined in:
lib/active_encode/callbacks.rb

Overview

These methods will be included into any Active Encode object, adding callbacks for create, cancel, and purge methods.

Instance Method Summary collapse

Instance Method Details

#after_cancel(*filters, &blk) ⇒ Object


48
49
50
# File 'lib/active_encode/callbacks.rb', line 48

def after_cancel(*filters, &blk)
  set_callback(:cancel, :after, *filters, &blk)
end

#after_create(*filters, &blk) ⇒ Object


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

def after_create(*filters, &blk)
  set_callback(:create, :after, *filters, &blk)
end

#after_purge(*filters, &blk) ⇒ Object


60
61
62
# File 'lib/active_encode/callbacks.rb', line 60

def after_purge(*filters, &blk)
  set_callback(:purge, :after, *filters, &blk)
end

#around_cancel(*filters, &blk) ⇒ Object


52
53
54
# File 'lib/active_encode/callbacks.rb', line 52

def around_cancel(*filters, &blk)
  set_callback(:cancel, :around, *filters, &blk)
end

#around_create(*filters, &blk) ⇒ Object


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

def around_create(*filters, &blk)
  set_callback(:create, :around, *filters, &blk)
end

#around_purge(*filters, &blk) ⇒ Object


64
65
66
# File 'lib/active_encode/callbacks.rb', line 64

def around_purge(*filters, &blk)
  set_callback(:purge, :around, *filters, &blk)
end

#before_cancel(*filters, &blk) ⇒ Object


44
45
46
# File 'lib/active_encode/callbacks.rb', line 44

def before_cancel(*filters, &blk)
  set_callback(:cancel, :before, *filters, &blk)
end

#before_create(*filters, &blk) ⇒ Object


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

def before_create(*filters, &blk)
  set_callback(:create, :before, *filters, &blk)
end

#before_purge(*filters, &blk) ⇒ Object


56
57
58
# File 'lib/active_encode/callbacks.rb', line 56

def before_purge(*filters, &blk)
  set_callback(:purge, :before, *filters, &blk)
end