class Sheen::Table::Filter

Overview

A Data presenting a predicate-filtered view of another Data's rows. #columns are never touched. Filtered out rows are skipped and reindexing is applied over survivors.

Defined in:

sheen/table.cr

Constructors

Instance Method Summary

Instance methods inherited from class Sheen::Table::Data

at(row : Int32, cell : Int32) : String at, columns : Int32 columns, rows : Int32 rows

Constructor Detail

def self.new(data : Data) #

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


[View source]

Instance Method Detail

def at(row : Int32, cell : Int32) : String #

The cell at the row-th passing row and cell column, or "" when out of range


[View source]
def columns : Int32 #

The wrapped data's column count


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

Sets the predicate block deciding whether the row at each index is kept.

Returns self.


[View source]
def rows : Int32 #

The number of passing rows.


[View source]