Module: Card::Log::Performance::BigBrother
- Defined in:
- lib/card/log.rb
Instance Method Summary collapse
- #watch_all_instance_methods ⇒ Object
- #watch_all_methods ⇒ Object
- #watch_all_singleton_methods ⇒ Object
- #watch_instance_method(*names) ⇒ Object
- #watch_method(method_name, method_type = :all, options = {}) ⇒ Object
- #watch_singleton_method(*names) ⇒ Object
Instance Method Details
#watch_all_instance_methods ⇒ Object
473 474 475 |
# File 'lib/card/log.rb', line 473 def watch_all_instance_methods watch_instance_method *instance_methods end |
#watch_all_methods ⇒ Object
482 483 484 485 |
# File 'lib/card/log.rb', line 482 def watch_all_methods watch_all_instance_methods watch_all_singleton_methods end |
#watch_all_singleton_methods ⇒ Object
477 478 479 480 |
# File 'lib/card/log.rb', line 477 def watch_all_singleton_methods fragile_methods = [:default_scope, :default_scopes, :default_scopes=] # if I touch these methods ActiveRecord breaks watch_singleton_method *(singleton_methods - fragile_methods) end |
#watch_instance_method(*names) ⇒ Object
461 462 463 464 465 |
# File 'lib/card/log.rb', line 461 def watch_instance_method *names names.each do |name| watch_method name, :instance end end |
#watch_method(method_name, method_type = :all, options = {}) ⇒ Object
448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/card/log.rb', line 448 def watch_method method_name, method_type=:all, ={} Card::Log::Performance.enable_method method_name if !SPECIAL_METHODS.include? method_name if method_type == :all || method_type == :singleton add_singleton_logging method_name, end if method_type == :all || method_type == :instance add_instance_logging method_name, end end end |
#watch_singleton_method(*names) ⇒ Object
467 468 469 470 471 |
# File 'lib/card/log.rb', line 467 def watch_singleton_method *names names.each do |name| watch_method name, :singleton end end |