Class: XDry::BaseFileRef

Inherits:
Object
  • Object
show all
Defined in:
lib/xdry/parsing/pos.rb

Direct Known Subclasses

FileRef, TestFileRef

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBaseFileRef

Returns a new instance of BaseFileRef.



8
9
10
# File 'lib/xdry/parsing/pos.rb', line 8

def initialize
  @positions = []
end

Instance Attribute Details

#positionsObject (readonly)

Returns the value of attribute positions.



6
7
8
# File 'lib/xdry/parsing/pos.rb', line 6

def positions
  @positions
end

Instance Method Details

#add_pos!(pos) ⇒ Object



12
13
14
# File 'lib/xdry/parsing/pos.rb', line 12

def add_pos! pos
  @positions << pos
end

#fixup_positions!(after_line_no, offset) ⇒ Object



16
17
18
# File 'lib/xdry/parsing/pos.rb', line 16

def fixup_positions! after_line_no, offset
  @positions.each { |pos| pos.fixup! after_line_no, offset }
end