Module: ActiveModel::Callbacks

Defined in:
lib/turning/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#on(event, &block) ⇒ Object



4
5
6
7
# File 'lib/turning/callbacks.rb', line 4

def on(event, &block)
  new_block = lambda { |instance| block.call(instance) }
  send(:"after_#{event}", &new_block)
end