Class: CC::Analyzer::LocationDescription
- Inherits:
-
Object
- Object
- CC::Analyzer::LocationDescription
- Defined in:
- lib/cc/analyzer/location_description.rb
Instance Method Summary collapse
-
#initialize(location, suffix = "") ⇒ LocationDescription
constructor
A new instance of LocationDescription.
- #to_s ⇒ Object
Constructor Details
#initialize(location, suffix = "") ⇒ LocationDescription
4 5 6 7 |
# File 'lib/cc/analyzer/location_description.rb', line 4 def initialize(location, suffix = "") @location = location @suffix = suffix end |
Instance Method Details
#to_s ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cc/analyzer/location_description.rb', line 9 def to_s str = "" if location["lines"] str << render_lines elsif positions = location["positions"] str << render_position(positions["begin"]) if positions["end"] str << "-" str << render_position(positions["end"]) end end str << suffix unless str.blank? str end |