Class: TLDR::Location
- Inherits:
-
Struct
- Object
- Struct
- TLDR::Location
- Defined in:
- lib/tldr/value/location.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file
2 3 4 |
# File 'lib/tldr/value/location.rb', line 2 def file @file end |
#line ⇒ Object
Returns the value of attribute line
2 3 4 |
# File 'lib/tldr/value/location.rb', line 2 def line @line end |
Instance Method Details
#locator ⇒ Object
11 12 13 |
# File 'lib/tldr/value/location.rb', line 11 def locator "#{relative}:#{line}" end |
#relative ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/tldr/value/location.rb', line 3 def relative if file.start_with?(Dir.pwd) file[Dir.pwd.length + 1..] else file end end |