class Sheen::Tree::Filter

Overview

A predicate-filtered, readonly view over another 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(data : Children) #

Wraps data. Every node passes until #filter is set.


[View source]

Instance Method Detail

def at(index : Int32) : Node | Nil #

The index-th passing node, or nil if out of range.


[View source]
def filter(&block : Node, Int32 -> Bool) : Filter #

The filter block that, given the node and its index in the wrapped data, decides whether each node is kept or filtered out.

Returns self.


[View source]
def length : Int32 #

The number of passing nodes.


[View source]