Method: Libsql::ProfileTap#initialize
- Defined in:
- lib/libsql/profile_tap.rb
#initialize(wrapped_obj, send_to = 'profile') ⇒ ProfileTap
Create a new ProfileTap object that wraps the given object and calls the method named in send_to ever time a profile event happens.
108 109 110 111 112 113 114 115 116 |
# File 'lib/libsql/profile_tap.rb', line 108 def initialize( wrapped_obj, send_to = 'profile' ) unless wrapped_obj.respond_to?( send_to ) raise ::Libsql::Error, "#{wrapped_obj.class.name} does not respond to #{send_to.to_s} " end @delegate_obj = wrapped_obj @delegate_method = send_to @samplers = {} end |