Class: CodeModels::EmbeddedArtifact
Instance Attribute Summary collapse
Instance Method Summary
collapse
#point_to_absolute, #position_to_absolute
Instance Attribute Details
#host_artifact ⇒ Object
Returns the value of attribute host_artifact.
27
28
29
|
# File 'lib/codemodels/artifact.rb', line 27
def host_artifact
@host_artifact
end
|
#position_in_host ⇒ Object
Returns the value of attribute position_in_host.
28
29
30
|
# File 'lib/codemodels/artifact.rb', line 28
def position_in_host
@position_in_host
end
|
Instance Method Details
#absolute_start ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/codemodels/artifact.rb', line 30
def absolute_start
p = host_artifact.absolute_start
p.line += position_in_host.begin_point.line-1
if position_in_host.begin_point.line==1
p.column += position_in_host.begin_point.column-1
else
p.column = position_in_host.begin_point.column
end
p
end
|
#code ⇒ Object
52
53
54
|
# File 'lib/codemodels/artifact.rb', line 52
def code
position_in_host.get_string(host_artifact.code)
end
|
#embedded? ⇒ Boolean
56
57
58
|
# File 'lib/codemodels/artifact.rb', line 56
def embedded?
true
end
|
#embedding_level ⇒ Object
60
61
62
|
# File 'lib/codemodels/artifact.rb', line 60
def embedding_level
@host_artifact.embedding_level+1
end
|
#final_host ⇒ Object
48
49
50
|
# File 'lib/codemodels/artifact.rb', line 48
def final_host
host_artifact.final_host
end
|
#name ⇒ Object
64
65
66
|
# File 'lib/codemodels/artifact.rb', line 64
def name
'<embedded>'
end
|
#to_s ⇒ Object
44
45
46
|
# File 'lib/codemodels/artifact.rb', line 44
def to_s
"Embedded in (#{@host_artifact.to_s}) at #{position_in_host}"
end
|