Class: MetricAdapter::Location
- Inherits:
-
Object
- Object
- MetricAdapter::Location
- Defined in:
- lib/location.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(combined_path, line = 0) ⇒ Location
constructor
A new instance of Location.
- #to_s ⇒ Object
Constructor Details
#initialize(combined_path, line = 0) ⇒ Location
Returns a new instance of Location.
5 6 7 8 |
# File 'lib/location.rb', line 5 def initialize(combined_path, line = 0) @path, @line = parse_path(combined_path || '') @line ||= line end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
3 4 5 |
# File 'lib/location.rb', line 3 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/location.rb', line 3 def path @path end |
Instance Method Details
#<=>(other) ⇒ Object
14 15 16 |
# File 'lib/location.rb', line 14 def <=>(other) [path,line] <=> [other.path, other.line] end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/location.rb', line 10 def to_s "#{path}:#{line}" end |