Module: Injection::ObserverExtension::ClassMethods

Defined in:
lib/injection/observer_inject.rb

Instance Method Summary collapse

Instance Method Details

#after(observation, &block) ⇒ Object

Specify what events the observer is interested in after an activerecord object has performed an operation by passing in a symbol and a block.



9
10
11
# File 'lib/injection/observer_inject.rb', line 9

def after(observation, &block)
  build_methods(:after, observation, &block)
end

#around(observation, &block) ⇒ Object

Specify what events the observer is interested in before and after an activerecord object has performed an operation by passing in a symbol and a block that yields.



23
24
25
# File 'lib/injection/observer_inject.rb', line 23

def around(observation, &block)
  build_methods(:around, observation, &block)
end

#before(observation, &block) ⇒ Object

Specify what events the observer is interested in before an activerecord object has performed an operation by passing in a symbol and a block.



16
17
18
# File 'lib/injection/observer_inject.rb', line 16

def before(observation, &block)
  build_methods(:before, observation, &block)
end