class Prism::Relocation::CodeUnitOffsetsField
A field representing the start and end code unit offsets.
A field representing the start and end code unit offsets.
Attributes
The associated encoding for the code units.
The associated encoding for the code units.
Repository
A pointer to the repository object that is used for lazily creating a code units cache.
A pointer to the repository object that is used for lazily creating a code units cache.
Public Class Methods
(Repository repository, Encoding encoding) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/relocation.rb, line 315 def initialize(repository, encoding) @repository = repository @encoding = encoding @cache = nil end
Initialize a new field with the associated repository and encoding.
Initialize a new field with the associated repository and encoding.
: (Repository repository, Encoding encoding) -> void
Public Instance Methods
(_Value value) → entry_values
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/lib/prism/relocation.rb, line 325 def fields(value) { start_code_units_offset: value.cached_start_code_units_offset(cache), end_code_units_offset: value.cached_end_code_units_offset(cache) } end
Fetches the start and end code units offset of a value for a particular encoding.
Fetches the start and end code units offset of a value for a particular encoding.
: (_Value value) -> entry_values