Class: CodeModels::AbstractArtifact

Inherits:
Object
  • Object
show all
Defined in:
lib/codemodels/artifact.rb

Direct Known Subclasses

EmbeddedArtifact, FileArtifact, StringArtifact

Instance Method Summary collapse

Instance Method Details

#point_to_absolute(point) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/codemodels/artifact.rb', line 8

def point_to_absolute(point)
  offset = absolute_start
  p = SourcePoint.new
  p.line   = point.line  + offset.line - 1
  p.column = point.column
  p.column  += offset.column-1 if point.line==1
  p
end

#position_to_absolute(position) ⇒ Object



17
18
19
20
21
22
# File 'lib/codemodels/artifact.rb', line 17

def position_to_absolute(position)
  pos = SourcePosition.new
  pos.begin_point = point_to_absolute(position.begin_point)
  pos.end_point = point_to_absolute(position.end_point)
  pos
end