class YARP::Location

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/yarp.rbs

class YARP::Location
  def end_line: () -> Integer
  def end_offset: () -> Integer
  def initialize: (YARP::Source source, Integer start_offset, Integer length) -> void
  def inspect: () -> String
  def slice: () -> String
  def start_column: () -> Integer
  def start_line: () -> Integer
end

This represents a location in the source.

def self.null

def self.null
  new(0, 0)
end

def ==(other)

def ==(other)
  other.is_a?(Location) &&
    other.start_offset == start_offset &&
    other.end_offset == end_offset
end

def deconstruct_keys(keys)

def deconstruct_keys(keys)
  { start_offset: start_offset, end_offset: end_offset }
end

def end_column

line.
The column number in bytes where this location ends from the start of the
def end_column
  source.column(end_offset - 1)
end

def end_line

Experimental RBS support (using type sampling data from the type_fusion project).

def end_line: () -> Integer

This signature was generated using 1 sample from 1 application.

The line number where this location ends.
def end_line
  source.line(end_offset - 1)
end

def end_offset

Experimental RBS support (using type sampling data from the type_fusion project).

def end_offset: () -> Integer

This signature was generated using 1 sample from 1 application.

The byte offset from the beginning of the source where this location ends.
def end_offset
  start_offset + length
end

def initialize(source, start_offset, length)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (YARP::Source source, Integer start_offset, Integer length) -> void

This signature was generated using 15676 samples from 1 application.

def initialize(source, start_offset, length)
  @source = source
  @start_offset = start_offset
  @length = length
end

def inspect

Experimental RBS support (using type sampling data from the type_fusion project).

def inspect: () -> String

This signature was generated using 5 samples from 1 application.

def inspect
  "#<YARP::Location @start_offset=#{@start_offset} @length=#{@length}>"
end

def pretty_print(q)

def pretty_print(q)
  q.text("(#{start_offset}...#{end_offset})")
end

def slice

Experimental RBS support (using type sampling data from the type_fusion project).

def slice: () -> String

This signature was generated using 1444 samples from 1 application.

The source code that this location represents.
def slice
  source.slice(start_offset, length)
end

def start_column

Experimental RBS support (using type sampling data from the type_fusion project).

def start_column: () -> Integer

This signature was generated using 1 sample from 1 application.

the line.
The column number in bytes where this location starts from the start of
def start_column
  source.column(start_offset)
end

def start_line

Experimental RBS support (using type sampling data from the type_fusion project).

def start_line: () -> Integer

This signature was generated using 1254 samples from 1 application.

The line number where this location starts.
def start_line
  source.line(start_offset)
end