Module: CassandraMapper::Observable

Included in:
Base
Defined in:
lib/cassandra_mapper/observable.rb

Constant Summary collapse

CALLBACKS =
[
  :after_load,
  :before_create,
  :after_create,
  :before_update,
  :after_update,
  :before_save,
  :after_save,
  :before_destroy,
  :after_destroy,
]

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/cassandra_mapper/observable.rb', line 23

def self.included(klass)
  klass.module_eval do
    include CassandraMapper::Support::Observing
    CALLBACKS.each do |callback|
      name = callback.to_s
      send(callback, :"_notify_observer_#{name}")
    end
  end
end