Class: Prism::Relocation::Source
- Inherits:
-
Object
- Object
- Prism::Relocation::Source
- Defined in:
- lib/prism/relocation.rb
Overview
Represents the source of a repository that will be reparsed.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
The value that will need to be reparsed.
Instance Method Summary collapse
-
#code_units_cache(encoding) ⇒ Object
Create a code units cache for the given encoding.
-
#initialize(value) ⇒ Source
constructor
Initialize the source with the given value.
-
#result ⇒ Object
Reparse the value and return the parse result.
Constructor Details
#initialize(value) ⇒ Source
Initialize the source with the given value.
154 155 156 |
# File 'lib/prism/relocation.rb', line 154 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
The value that will need to be reparsed.
151 152 153 |
# File 'lib/prism/relocation.rb', line 151 def value @value end |
Instance Method Details
#code_units_cache(encoding) ⇒ Object
Create a code units cache for the given encoding.
164 165 166 |
# File 'lib/prism/relocation.rb', line 164 def code_units_cache(encoding) result.code_units_cache(encoding) end |
#result ⇒ Object
Reparse the value and return the parse result.
159 160 161 |
# File 'lib/prism/relocation.rb', line 159 def result raise NotImplementedError, "Subclasses must implement #result" end |