Class: RubySnooper::TraceWriter::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_snooper/trace_writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_id, event, number, time, code, local_variables, new_variables, modified_variables, file_path) ⇒ Line

Returns a new instance of Line.



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/ruby_snooper/trace_writer.rb', line 64

def initialize(method_id, event, number, time, code, local_variables, new_variables, modified_variables, file_path)
  @method_id = method_id
  @event = event
  @number = number
  @time = time
  @code = code
  @local_variables = local_variables
  @new_variables = new_variables
  @modified_variables = modified_variables
  @file_path = file_path
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def code
  @code
end

#eventObject (readonly)

Returns the value of attribute event.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def event
  @event
end

#local_variablesObject (readonly)

Returns the value of attribute local_variables.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def local_variables
  @local_variables
end

#method_idObject (readonly)

Returns the value of attribute method_id.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def method_id
  @method_id
end

#modified_variablesObject (readonly)

Returns the value of attribute modified_variables.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def modified_variables
  @modified_variables
end

#new_variablesObject (readonly)

Returns the value of attribute new_variables.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def new_variables
  @new_variables
end

#numberObject (readonly)

Returns the value of attribute number.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def number
  @number
end

#timeObject (readonly)

Returns the value of attribute time.



62
63
64
# File 'lib/ruby_snooper/trace_writer.rb', line 62

def time
  @time
end

Instance Method Details



76
77
78
79
80
# File 'lib/ruby_snooper/trace_writer.rb', line 76

def print
  STDERR.puts "From #{@file_path}" if @event == :call
  print_variables
  STDERR.puts "#{Time.now.strftime("%T,%L")} #{@event}   #{number} #{code}"
end