123456789_123456789_123456789_123456789_123456789_

Class: Prism::Relocation::Source

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: lib/prism/relocation.rb

Overview

Represents the source of a repository that will be reparsed.

Class Method Summary

Instance Attribute Summary

  • #value readonly

    The value that will need to be reparsed.

Instance Method Summary

Constructor Details

.new(value) ⇒ Source

Initialize the source with the given value.

[ GitHub ]

  
# File 'lib/prism/relocation.rb', line 153

def initialize(value)
  @value = value
end

Instance Attribute Details

#value (readonly)

The value that will need to be reparsed.

[ GitHub ]

  
# File 'lib/prism/relocation.rb', line 150

attr_reader :value

Instance Method Details

#code_units_cache(encoding)

Create a code units cache for the given encoding.

[ GitHub ]

  
# File 'lib/prism/relocation.rb', line 163

def code_units_cache(encoding)
  result.code_units_cache(encoding)
end

#result

Reparse the value and return the parse result.

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'lib/prism/relocation.rb', line 158

def result
  raise NotImplementedError, "Subclasses must implement #result"
end