Class: Archsight::LineReference

Inherits:
Object
  • Object
show all
Defined in:
lib/archsight/database.rb

Overview

LineReference combines a path and line reference

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, line_no) ⇒ LineReference

Returns a new instance of LineReference.



13
14
15
16
# File 'lib/archsight/database.rb', line 13

def initialize(path, line_no)
  @path = path
  @line_no = line_no
end

Instance Attribute Details

#line_noObject

Returns the value of attribute line_no.



11
12
13
# File 'lib/archsight/database.rb', line 11

def line_no
  @line_no
end

#pathObject

Returns the value of attribute path.



11
12
13
# File 'lib/archsight/database.rb', line 11

def path
  @path
end

Instance Method Details

#at_line(line_no) ⇒ Object



22
23
24
# File 'lib/archsight/database.rb', line 22

def at_line(line_no)
  self.class.new(@path, line_no)
end

#to_sObject



18
19
20
# File 'lib/archsight/database.rb', line 18

def to_s
  "#{@path}:#{@line_no}"
end