ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- U:RDoc::AnyMethod[iI" enable:ETI"TracePoint#enable;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Activates the trace.;To:RDoc::Markup::BlankLineo; ; [I"*Returns +true+ if trace was enabled. ;TI"+Returns +false+ if trace was disabled.;T@o:RDoc::Markup::Verbatim; [ I"trace.enabled? #=> false ;TI"0trace.enable #=> false (previous state) ;TI"* # trace is enabled ;TI"trace.enabled? #=> true ;TI"/trace.enable #=> true (previous state) ;TI"0 # trace is still enabled ;T: @format0o; ; [I"QIf a block is given, the trace will only be enabled within the scope of the ;TI" block.;T@o; ; [I"trace.enabled? ;TI"#=> false ;TI" ;TI"trace.enable do ;TI" trace.enabled? ;TI"% # only enabled for this block ;TI" end ;TI" ;TI"trace.enabled? ;TI"#=> false ;T; 0o; ; [ I"H+target+, +target_line+ and +target_thread+ parameters are used to ;TI"Hlimit tracing only to specified code objects. +target+ should be a ;TI"Fcode object for which RubyVM::InstructionSequence.of will return ;TI"an instruction sequence.;T@o; ; [I"-t = TracePoint.new(:line) { |tp| p tp } ;TI" ;TI" def m1 ;TI" p 1 ;TI" end ;TI" ;TI" def m2 ;TI" p 2 ;TI" end ;TI" ;TI"#t.enable(target: method(:m1)) ;TI" ;TI"m1 ;TI"3# prints # ;TI"m2 ;TI"# prints nothing ;T; 0o; ; [I"CNote: You cannot access event hooks within the +enable+ block.;T@o; ; [I""trace.enable { p tp.lineno } ;TI"*#=> RuntimeError: access from outside;T; 0: @fileI"trace_point.rb;T:0@omit_headings_from_table_of_contents_below0I"¦trace.enable(target: nil, target_line: nil, target_thread: nil) -> true or false trace.enable(target: nil, target_line: nil, target_thread: nil) { block } -> obj ;T0[I"8(target: nil, target_line: nil, target_thread: nil);T@JFI"TracePoint;TcRDoc::NormalClass00