class Sheen::Tree::NodeChildren

Overview

A readonly view over a node's children.

A mutable, array-backed implementation of Children.

Defined in:

sheen/tree.cr

Constructors

Instance Method Summary

Instance methods inherited from class Sheen::Tree::Children

at(index : Int32) : Node | Nil at, length : Int32 length

Constructor Detail

def self.new(nodes : Array(Node) = [] of Node) #

[View source]

Instance Method Detail

def append(node : Node) : NodeChildren #

Appends node to the NodeChildren self.


[View source]
def at(index : Int32) : Node | Nil #

The node at index, or nil when out of range.


[View source]
def length : Int32 #

The number of children.


[View source]
def remove(index : Int32) : NodeChildren #

Removes the node at index. Out of range indices are ignored.

Returns self.


[View source]