Class: Prism::Relocation::Entry
- Inherits:
-
Object
- Object
- Prism::Relocation::Entry
- Defined in:
- lib/prism/relocation.rb
Overview
An entry in a repository that will lazily reify its values when they are first accessed.
Defined Under Namespace
Classes: MissingValueError
Instance Method Summary collapse
-
#comments ⇒ Object
Fetch the leading and trailing comments of the value.
-
#end_character_column ⇒ Object
Fetch the end character column of the value.
-
#end_character_offset ⇒ Object
Fetch the end character offset of the value.
-
#end_code_units_column ⇒ Object
Fetch the end code units column of the value, for the encoding that was configured on the repository.
-
#end_code_units_offset ⇒ Object
Fetch the end code units offset of the value, for the encoding that was configured on the repository.
-
#end_column ⇒ Object
Fetch the end byte column of the value.
-
#end_line ⇒ Object
Fetch the end line of the value.
-
#end_offset ⇒ Object
Fetch the end byte offset of the value.
-
#filepath ⇒ Object
Fetch the filepath of the value.
-
#initialize(repository) ⇒ Entry
constructor
Initialize a new entry with the given repository.
-
#leading_comments ⇒ Object
Fetch the leading comments of the value.
-
#reify!(values) ⇒ Object
Reify the values on this entry with the given values.
-
#start_character_column ⇒ Object
Fetch the start character column of the value.
-
#start_character_offset ⇒ Object
Fetch the start character offset of the value.
-
#start_code_units_column ⇒ Object
Fetch the start code units column of the value, for the encoding that was configured on the repository.
-
#start_code_units_offset ⇒ Object
Fetch the start code units offset of the value, for the encoding that was configured on the repository.
-
#start_column ⇒ Object
Fetch the start byte column of the value.
-
#start_line ⇒ Object
Fetch the start line of the value.
-
#start_offset ⇒ Object
Fetch the start byte offset of the value.
-
#trailing_comments ⇒ Object
Fetch the trailing comments of the value.
Constructor Details
#initialize(repository) ⇒ Entry
Initialize a new entry with the given repository.
25 26 27 28 |
# File 'lib/prism/relocation.rb', line 25 def initialize(repository) @repository = repository @values = nil end |
Instance Method Details
#comments ⇒ Object
Fetch the leading and trailing comments of the value.
120 121 122 |
# File 'lib/prism/relocation.rb', line 120 def comments leading_comments.concat(trailing_comments) end |
#end_character_column ⇒ Object
Fetch the end character column of the value.
93 94 95 |
# File 'lib/prism/relocation.rb', line 93 def end_character_column fetch_value(:end_character_column) end |
#end_character_offset ⇒ Object
Fetch the end character offset of the value.
61 62 63 |
# File 'lib/prism/relocation.rb', line 61 def end_character_offset fetch_value(:end_character_offset) end |
#end_code_units_column ⇒ Object
Fetch the end code units column of the value, for the encoding that was configured on the repository.
105 106 107 |
# File 'lib/prism/relocation.rb', line 105 def end_code_units_column fetch_value(:end_code_units_column) end |
#end_code_units_offset ⇒ Object
Fetch the end code units offset of the value, for the encoding that was configured on the repository.
73 74 75 |
# File 'lib/prism/relocation.rb', line 73 def end_code_units_offset fetch_value(:end_code_units_offset) end |
#end_column ⇒ Object
Fetch the end byte column of the value.
83 84 85 |
# File 'lib/prism/relocation.rb', line 83 def end_column fetch_value(:end_column) end |
#end_line ⇒ Object
Fetch the end line of the value.
41 42 43 |
# File 'lib/prism/relocation.rb', line 41 def end_line fetch_value(:end_line) end |
#end_offset ⇒ Object
Fetch the end byte offset of the value.
51 52 53 |
# File 'lib/prism/relocation.rb', line 51 def end_offset fetch_value(:end_offset) end |
#filepath ⇒ Object
Fetch the filepath of the value.
31 32 33 |
# File 'lib/prism/relocation.rb', line 31 def filepath fetch_value(:filepath) end |
#leading_comments ⇒ Object
Fetch the leading comments of the value.
110 111 112 |
# File 'lib/prism/relocation.rb', line 110 def leading_comments fetch_value(:leading_comments) end |
#reify!(values) ⇒ Object
Reify the values on this entry with the given values. This is an internal-only API that is called from the repository when it is time to reify the values.
127 128 129 130 |
# File 'lib/prism/relocation.rb', line 127 def reify!(values) # :nodoc: @repository = nil @values = values end |
#start_character_column ⇒ Object
Fetch the start character column of the value.
88 89 90 |
# File 'lib/prism/relocation.rb', line 88 def start_character_column fetch_value(:start_character_column) end |
#start_character_offset ⇒ Object
Fetch the start character offset of the value.
56 57 58 |
# File 'lib/prism/relocation.rb', line 56 def start_character_offset fetch_value(:start_character_offset) end |
#start_code_units_column ⇒ Object
Fetch the start code units column of the value, for the encoding that was configured on the repository.
99 100 101 |
# File 'lib/prism/relocation.rb', line 99 def start_code_units_column fetch_value(:start_code_units_column) end |
#start_code_units_offset ⇒ Object
Fetch the start code units offset of the value, for the encoding that was configured on the repository.
67 68 69 |
# File 'lib/prism/relocation.rb', line 67 def start_code_units_offset fetch_value(:start_code_units_offset) end |
#start_column ⇒ Object
Fetch the start byte column of the value.
78 79 80 |
# File 'lib/prism/relocation.rb', line 78 def start_column fetch_value(:start_column) end |
#start_line ⇒ Object
Fetch the start line of the value.
36 37 38 |
# File 'lib/prism/relocation.rb', line 36 def start_line fetch_value(:start_line) end |
#start_offset ⇒ Object
Fetch the start byte offset of the value.
46 47 48 |
# File 'lib/prism/relocation.rb', line 46 def start_offset fetch_value(:start_offset) end |
#trailing_comments ⇒ Object
Fetch the trailing comments of the value.
115 116 117 |
# File 'lib/prism/relocation.rb', line 115 def trailing_comments fetch_value(:trailing_comments) end |