1. Prism::
  2. Relocation::
  3. CodeUnitColumnsField

class Prism::Relocation::CodeUnitColumnsField

A field representing the start and end code unit columns for a specific encoding.

Attributes

encoding[R]

The associated encoding for the code units.

repository[R]

The repository object that is used for lazily creating a code units cache.

Public Class Methods

Source
# File lib/prism/relocation.rb, line 291definitialize(repository,encoding)@repository =repository@encoding =encoding@cache =nilend

Initialize a new field with the associated repository and encoding.

Public Instance Methods

Source
# File lib/prism/relocation.rb, line 299deffields(value)  {start_code_units_column:value.cached_start_code_units_column(cache),end_code_units_column:value.cached_end_code_units_column(cache)  }end

Fetches the start and end code units column of a value for a particular encoding.

Private Instance Methods

Source
# File lib/prism/relocation.rb, line 309defcache@cache||=repository.code_units_cache(encoding)end

Lazily create a code units cache for the associated encoding.