class RubySnooper::TraceWriter::Return
Attributes
code[R]
event[R]
method_id[R]
number[R]
return_value[R]
time[R]
Public Class Methods
new(method_id, event, number, time, code, return_value, file_path)
click to toggle source
# File lib/ruby_snooper/trace_writer.rb, line 114 def initialize(method_id, event, number, time, code, return_value, file_path) @method_id = method_id @event = event @number = number @time = time @code = code @return_value = return_value @file_path = file_path end
Public Instance Methods
code_colorized(str)
click to toggle source
# File lib/ruby_snooper/trace_writer.rb, line 129 def code_colorized(str) ::CodeRay.scan(str, :ruby).term end
colorized(str)
click to toggle source
# File lib/ruby_snooper/trace_writer.rb, line 133 def colorized(str) "\e[0;31m#{str}\e[0m" end
print()
click to toggle source
# File lib/ruby_snooper/trace_writer.rb, line 124 def print STDERR.puts "#{Time.now.strftime("%T,%L")} #{@event} #{@number.to_s.rjust(4)} #{code_colorized(@code)}" STDERR.puts colorized("Return value #{@return_value}") end