struct Line

Overview

Represents a logical line in a TextBuffer.

Defined in:

aspis/line.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(buf : TextBuffer, ord : Int32, b : Int32, e : Int32) #

[View source]

Instance Method Detail

def ==(other : self) #

Two lines are equal if their buffers and bounds are equal.


def [](index : Int) #

Returns the index-th character in this line.


[View source]
def b : Int32 #

Returns the index where this line starts.


[View source]
def content #

Returns the content of this line.


[View source]
def e : Int32 #

Returns the index where this line ends.


[View source]
def each_char(&) #

Yields each character in this line.


[View source]
def empty? #

Returns whether this line is empty.


[View source]
def first_line? #

Returns whether this line is the first line.


[View source]
def hash(hasher) #

Two lines are equal if their buffers and bounds are equal.


def in_buffer?(other : TextBuffer) #

Returns whether this line is in the other buffer.


[View source]
def includes?(index : Int) #

Returns whether index is in this line's bounds.


[View source]
def includes?(range : Range) #

Returns whether range is completely included in the bounds of this line.


[View source]
def inspect(io) #

[View source]
def last_line? #

Returns whether this line is the last line.


[View source]
def ord : Int32 #

Returns the ordinal of this line.


[View source]
def size #

Returns the amount of characters in this line.


[View source]
def slice(b : Int, e : Int) #

Returns a slice of this line's content.


[View source]
def upto(other : Line, &) #

Yields lines starting from this line and up to other line, both included.


[View source]