Class: TraceViewer::LineDetail
- Inherits:
-
Object
- Object
- TraceViewer::LineDetail
- Defined in:
- lib/trace_viewer/line_detail.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#function_node ⇒ Object
Returns the value of attribute function_node.
-
#line_number ⇒ Object
Returns the value of attribute line_number.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/trace_viewer/line_detail.rb', line 3 def filename @filename end |
#function_node ⇒ Object
Returns the value of attribute function_node.
3 4 5 |
# File 'lib/trace_viewer/line_detail.rb', line 3 def function_node @function_node end |
#line_number ⇒ Object
Returns the value of attribute line_number.
3 4 5 |
# File 'lib/trace_viewer/line_detail.rb', line 3 def line_number @line_number end |
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/trace_viewer/line_detail.rb', line 3 def source @source end |
Instance Method Details
#formatted_source ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/trace_viewer/line_detail.rb', line 9 def formatted_source @formatted_source ||= begin if (source) source = self.source.clone source[0] =~ /^(\s+)/ leading_characters = $1 || '' source.map {|line| line ? line.sub(leading_characters, '') : nil } else [] end end end |
#line_count ⇒ Object
5 6 7 |
# File 'lib/trace_viewer/line_detail.rb', line 5 def line_count formatted_source.size end |