Class Amalgalite::TraceTap
In: lib/amalgalite/trace_tap.rb
Parent: Object

A TraceTap receives tracing information from SQLite3. It receives the SQL statement being executed as a msg just before the statement first begins executing.

A TraceTap is a wrapper around another object and a method. The Tap object will receive the call to trace and redirect that call to another object and method.

Methods

new   trace  

Attributes

delegate_method  [R] 
delegate_obj  [R] 

Public Class methods

[Source]

    # File lib/amalgalite/trace_tap.rb, line 21
21:     def initialize( wrapped_obj, send_to = 'trace' )
22:       unless wrapped_obj.respond_to?( send_to ) 
23:         raise Amalgalite::Error, "#{wrapped_obj.class.name} does not respond to #{send_to.to_s} "
24:       end
25: 
26:       @delegate_obj = wrapped_obj
27:       @delegate_method = send_to
28:     end

Public Instance methods

[Source]

    # File lib/amalgalite/trace_tap.rb, line 30
30:     def trace( msg )
31:       delegate_obj.send( delegate_method, msg )
32:     end

[Validate]