Class: Ephemeron::Callbacks

Inherits:
ThreadStore
  • Object
show all
Defined in:
lib/ephemeron/writers/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#add(callback) ⇒ Object



11
12
13
# File 'lib/ephemeron/writers/callbacks.rb', line 11

def add(callback)
  after_save_callbacks << callback
end

#after_save_callbacksObject



7
8
9
# File 'lib/ephemeron/writers/callbacks.rb', line 7

def after_save_callbacks
  self.ts_after_save_callbacks ||= []
end

#callObject



15
16
17
# File 'lib/ephemeron/writers/callbacks.rb', line 15

def call
  after_save_callbacks.each(&:call)
end

#resetObject



19
20
21
# File 'lib/ephemeron/writers/callbacks.rb', line 19

def reset
  self.ts_after_save_callbacks = []
end