class YARP::Location

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

# sig/yarp.rbs

class YARP::Location
  def initialize: (YARP::Source source, Integer start_offset, Integer length) -> void
  def slice: () -> untyped
  def start_line: () -> untyped
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

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

def end_offset

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 867 samples from 1 application.

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

def inspect

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: () -> untyped

This signature was generated using 47 samples from 1 application.

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

def start_column

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: () -> untyped

This signature was generated using 47 samples from 1 application.

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