Class: RubySnooper::TraceWriter::Line
- Inherits:
-
Object
- Object
- RubySnooper::TraceWriter::Line
- Defined in:
- lib/ruby_snooper/trace_writer.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#local_variables ⇒ Object
readonly
Returns the value of attribute local_variables.
-
#method_id ⇒ Object
readonly
Returns the value of attribute method_id.
-
#modified_variables ⇒ Object
readonly
Returns the value of attribute modified_variables.
-
#new_variables ⇒ Object
readonly
Returns the value of attribute new_variables.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(method_id, event, number, time, code, local_variables, new_variables, modified_variables, file_path) ⇒ Line
constructor
A new instance of Line.
- #print ⇒ Object
Constructor Details
#initialize(method_id, event, number, time, code, local_variables, new_variables, modified_variables, file_path) ⇒ Line
Returns a new instance of Line.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/ruby_snooper/trace_writer.rb', line 66 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
#code ⇒ Object (readonly)
Returns the value of attribute code.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def code @code end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def event @event end |
#local_variables ⇒ Object (readonly)
Returns the value of attribute local_variables.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def local_variables @local_variables end |
#method_id ⇒ Object (readonly)
Returns the value of attribute method_id.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def method_id @method_id end |
#modified_variables ⇒ Object (readonly)
Returns the value of attribute modified_variables.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def modified_variables @modified_variables end |
#new_variables ⇒ Object (readonly)
Returns the value of attribute new_variables.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def new_variables @new_variables end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def number @number end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
64 65 66 |
# File 'lib/ruby_snooper/trace_writer.rb', line 64 def time @time end |
Instance Method Details
#print ⇒ Object
78 79 80 81 82 |
# File 'lib/ruby_snooper/trace_writer.rb', line 78 def print STDERR.puts "From #{@file_path}" if @event == :call print_variables STDERR.puts "#{Time.now.strftime("%T,%L")} #{@event} #{number.to_s.rjust(4)} #{code_colorized(code)}" end |