Ameba::Ext::Location - ameba 1.7.0

# module Ameba::Ext::Location

##
Overview

Extensions to `Crystal::Location`

##
Direct including types

- Crystal::Location

##
Defined in:

ameba/ext/location.cr

##
Instance Method Summary

- #adjust(line_number = 0, column_number = 0) : self

  Returns the same location as this location but with the line and/or column number(s) adjusted by the given amount(s).

- #relative(base = Dir.current) : self

  Returns `self` relative to the given base directory.

- #same_line?(other : self | Nil) : Bool

  Returns `true` if the line numbers of `self` and other are the same.

- #seek(offset : self) : self

  Seeks to a given offset relative to `self`.

- #with(line_number = @line_number, column_number = @column_number) : self

  Returns the same location as this location but with the line and/or column number(s) changed to the given value(s).

##
Instance Method Detail

def adjust(line_number = 0, column_number = 0) : self #

Returns the same location as this location but with the line and/or column number(s) adjusted by the given amount(s).

def relative(base = Dir.current) : self #

Returns `self` relative to the given base directory.

def same_line?(other : self | Nil) : Bool #

Returns `true` if the line numbers of `self` and other are the same.

def seek(offset : self) : self #

Seeks to a given offset relative to `self`.

def with(line_number = @line_number, column_number = @column_number) : self #

Returns the same location as this location but with the line and/or column number(s) changed to the given value(s).