class Prism::Relocation::Entry - Documentation for Ruby 3.4
Description: class Prism::Relocation::Entry: An entry in a repository that will lazily reify its values when they are first accessed.
Keywords: ruby,class,Prism::Relocation::Entry

# class Prism::Relocation::Entry

An entry in a repository that will lazily reify its values when they are first accessed.

### Public Class Methods

new (repository)
Source

    # File lib/prism/relocation.rb, line 25
    def initialize(repository)
      @repository = repository
      @values = nil
    end

Initialize a new entry with the given repository.

### Public Instance Methods

comments ()
Source

    # File lib/prism/relocation.rb, line 120
    def comments
      leading_comments.concat(trailing_comments)
    end

Fetch the leading and trailing comments of the value.

end_character_column ()
Source

    # File lib/prism/relocation.rb, line 93
    def end_character_column
      fetch_value(:end_character_column)
    end

Fetch the end character column of the value.

end_character_offset ()
Source

    # File lib/prism/relocation.rb, line 61
    def end_character_offset
      fetch_value(:end_character_offset)
    end

Fetch the end character offset of the value.

end_code_units_column ()
Source

    # File lib/prism/relocation.rb, line 105
    def end_code_units_column
      fetch_value(:end_code_units_column)
    end

Fetch the end code units column of the value, for the encoding that was configured on the repository.

end_code_units_offset ()
Source

    # File lib/prism/relocation.rb, line 73
    def end_code_units_offset
      fetch_value(:end_code_units_offset)
    end

Fetch the end code units offset of the value, for the encoding that was configured on the repository.

end_column ()
Source

    # File lib/prism/relocation.rb, line 83
    def end_column
      fetch_value(:end_column)
    end

Fetch the end byte column of the value.

end_line ()
Source

    # File lib/prism/relocation.rb, line 41
    def end_line
      fetch_value(:end_line)
    end

Fetch the end line of the value.

end_offset ()
Source

    # File lib/prism/relocation.rb, line 51
    def end_offset
      fetch_value(:end_offset)
    end

Fetch the end byte offset of the value.

filepath ()
Source

    # File lib/prism/relocation.rb, line 31
    def filepath
      fetch_value(:filepath)
    end

Fetch the filepath of the value.

leading_comments ()
Source

    # File lib/prism/relocation.rb, line 110
    def leading_comments
      fetch_value(:leading_comments)
    end

Fetch the leading comments of the value.

start_character_column ()
Source

    # File lib/prism/relocation.rb, line 88
    def start_character_column
      fetch_value(:start_character_column)
    end

Fetch the start character column of the value.

start_character_offset ()
Source

    # File lib/prism/relocation.rb, line 56
    def start_character_offset
      fetch_value(:start_character_offset)
    end

Fetch the start character offset of the value.

start_code_units_column ()
Source

    # File lib/prism/relocation.rb, line 99
    def start_code_units_column
      fetch_value(:start_code_units_column)
    end

Fetch the start code units column of the value, for the encoding that was configured on the repository.

start_code_units_offset ()
Source

    # File lib/prism/relocation.rb, line 67
    def start_code_units_offset
      fetch_value(:start_code_units_offset)
    end

Fetch the start code units offset of the value, for the encoding that was configured on the repository.

start_column ()
Source

    # File lib/prism/relocation.rb, line 78
    def start_column
      fetch_value(:start_column)
    end

Fetch the start byte column of the value.

start_line ()
Source

    # File lib/prism/relocation.rb, line 36
    def start_line
      fetch_value(:start_line)
    end

Fetch the start line of the value.

start_offset ()
Source

    # File lib/prism/relocation.rb, line 46
    def start_offset
      fetch_value(:start_offset)
    end

Fetch the start byte offset of the value.

trailing_comments ()
Source

    # File lib/prism/relocation.rb, line 115
    def trailing_comments
      fetch_value(:trailing_comments)
    end

Fetch the trailing comments of the value.

### Private Instance Methods

fetch_value (name)
Source

    # File lib/prism/relocation.rb, line 135
    def fetch_value(name)
      values.fetch(name) do
        raise MissingValueError, "No value for #{name}, make sure the " \
          "repository has been properly configured"
      end
    end

Fetch a value from the entry, raising an error if it is missing.

values ()
Source

    # File lib/prism/relocation.rb, line 143
    def values
      @values || (@repository.reify!; @values)
    end

Return the values from the repository, reifying them if necessary.