Module: Peekaboo::SingletonMethods
- Defined in:
- lib/peekaboo.rb
Overview
Contains methods added to every class that includes the Peekaboo module, either through direct or auto inclusion.
Instance Method Summary collapse
-
#enable_tracing_on(*method_names) ⇒ Object
Enables instance method tracing on calling class.
-
#peek_list ⇒ Array<Symbol>
A list of instance methods that are being traced inside calling class.
Instance Method Details
#enable_tracing_on(*method_names) ⇒ Object
Enables instance method tracing on calling class.
112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/peekaboo.rb', line 112 def enable_tracing_on *method_names include Peekaboo unless @_hooked_by_peekaboo method_names.each do |method_name| unless peek_list.include? method_name peek_list << method_name Peekaboo.wrap_method self, method_name if self.instance_methods(false).include? method_name.to_s else raise "Already tracing `#{method_name}'" end end end |
#peek_list ⇒ Array<Symbol>
Returns a list of instance methods that are being traced inside calling class.
90 91 92 |
# File 'lib/peekaboo.rb', line 90 def peek_list self::PEEKABOO_METHOD_LIST end |