Class: Decode::Location
- Inherits:
-
Object
- Object
- Decode::Location
- Defined in:
- lib/decode/location.rb
Overview
Represents a location in a source file.
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
- #The line number in the source file.(linenumber) ⇒ Object readonly
- #The path to the source file.(pathtothesourcefile.) ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(path, line) ⇒ Location
constructor
Initialize a new location.
-
#to_s ⇒ Object
Generate a string representation of the location.
Constructor Details
#initialize(path, line) ⇒ Location
Initialize a new location.
12 13 14 15 |
# File 'lib/decode/location.rb', line 12 def initialize(path, line) @path = path @line = line end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
21 22 23 |
# File 'lib/decode/location.rb', line 21 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
18 19 20 |
# File 'lib/decode/location.rb', line 18 def path @path end |
#The line number in the source file.(linenumber) ⇒ Object (readonly)
21 |
# File 'lib/decode/location.rb', line 21 attr :line |
#The path to the source file.(pathtothesourcefile.) ⇒ Object (readonly)
18 |
# File 'lib/decode/location.rb', line 18 attr :path |
Instance Method Details
#to_s ⇒ Object
Generate a string representation of the location.
24 25 26 |
# File 'lib/decode/location.rb', line 24 def to_s "#{path}:#{line}" end |