Class: CodeModels::SourceInfo
- Inherits:
-
Object
- Object
- CodeModels::SourceInfo
- Defined in:
- lib/codemodels/source_info.rb
Instance Attribute Summary collapse
-
#artifact(scope = :relative) ⇒ Object
Returns the value of attribute artifact.
-
#position(flag = :relative) ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
- #absolute_position ⇒ Object
- #begin_column(flag = :relative) ⇒ Object
- #begin_line(flag = :relative) ⇒ Object
- #begin_point(flag = :relative) ⇒ Object
- #begin_point=(data) ⇒ Object
- #code ⇒ Object
- #embedded? ⇒ Boolean
- #embedding_level ⇒ Object
- #end_column(flag = :relative) ⇒ Object
- #end_line(flag = :relative) ⇒ Object
- #end_point(flag = :relative) ⇒ Object
- #end_point=(data) ⇒ Object
Instance Attribute Details
#artifact(scope = :relative) ⇒ Object
Returns the value of attribute artifact.
11 12 13 |
# File 'lib/codemodels/source_info.rb', line 11 def artifact @artifact end |
#position(flag = :relative) ⇒ Object
Returns the value of attribute position.
12 13 14 |
# File 'lib/codemodels/source_info.rb', line 12 def position @position end |
Instance Method Details
#absolute_position ⇒ Object
82 83 84 85 |
# File 'lib/codemodels/source_info.rb', line 82 def absolute_position raise "#{self} is not placed in any artifact" unless @artifact @artifact.position_to_absolute(@position) end |
#begin_column(flag = :relative) ⇒ Object
54 55 56 |
# File 'lib/codemodels/source_info.rb', line 54 def begin_column(flag=:relative) position(flag).begin_point.column end |
#begin_line(flag = :relative) ⇒ Object
46 47 48 |
# File 'lib/codemodels/source_info.rb', line 46 def begin_line(flag=:relative) position.begin_point.line end |
#begin_point(flag = :relative) ⇒ Object
62 63 64 |
# File 'lib/codemodels/source_info.rb', line 62 def begin_point(flag=:relative) position(flag).begin_point end |
#begin_point=(data) ⇒ Object
34 35 36 37 38 |
# File 'lib/codemodels/source_info.rb', line 34 def begin_point=(data) point = data_to_point(data) @position = SourcePosition.new unless @position @position.begin_point = point end |
#code ⇒ Object
25 26 27 |
# File 'lib/codemodels/source_info.rb', line 25 def code position(:absolute).get_string(artifact.final_host.code) end |
#embedded? ⇒ Boolean
87 88 89 |
# File 'lib/codemodels/source_info.rb', line 87 def @artifact. end |
#embedding_level ⇒ Object
91 92 93 |
# File 'lib/codemodels/source_info.rb', line 91 def @artifact. end |
#end_column(flag = :relative) ⇒ Object
58 59 60 |
# File 'lib/codemodels/source_info.rb', line 58 def end_column(flag=:relative) position(flag).end_point.column end |
#end_line(flag = :relative) ⇒ Object
50 51 52 |
# File 'lib/codemodels/source_info.rb', line 50 def end_line(flag=:relative) position(flag).end_point.line end |
#end_point(flag = :relative) ⇒ Object
66 67 68 |
# File 'lib/codemodels/source_info.rb', line 66 def end_point(flag=:relative) position(flag).end_point end |
#end_point=(data) ⇒ Object
40 41 42 43 44 |
# File 'lib/codemodels/source_info.rb', line 40 def end_point=(data) point = data_to_point(data) @position = SourcePosition.new unless @position @position.end_point = point end |