lib/pulse_meter/observer.rb
# Registeres an observer for class method
# @param klass [Class] class
# @param method [Symbol] class method
# @param sensor [Object] notifications receiver
# @param proc [Proc] proc to be called in context of receiver each time observed method called
Registeres an observer for class method
Registeres an observer for class method
def observe_class_method(klass, method, sensor, &proc)
        with_observer = method_with_observer(method)
        method_owner = metaclass(klass)
        unless has_method?(method_owner, with_observer)
          block = chain_block(method, sensor, &proc)
          method_owner.instance_eval &block
        end
      end
def observe_class_method ( klass , method , sensor , & proc ) with_observer = method_with_observer ( method ) method_owner = metaclass ( klass ) unless has_method? ( method_owner , with_observer ) block = chain_block ( method , sensor , & proc ) method_owner . instance_eval & block end end
Registeres an observer for class method
Registeres an observer for class method
klass
None
method
None
sensor
None
proc
proc to be called in context of receiver each time observed method called
proc to be called in context of receiver each time observed method called