Class: TTY::Table::Operation::Filter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/tty/table/operation/filter.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A class responsible for transforming table field

Instance Method Summary collapse

Constructor Details

#initialize(filter) ⇒ Filter

Initialize a Filter



13
14
15
# File 'lib/tty/table/operation/filter.rb', line 13

def initialize(filter)
  @filter = filter
end

Instance Method Details

#call(field, row, col) ⇒ Object

Apply filer to the provided table field

Parameters:

  • field (TTY::Table::Field)
  • row (Integer)

    the field row index

  • col (Integer)

    the field column index



28
29
30
# File 'lib/tty/table/operation/filter.rb', line 28

def call(field, row, col)
  @filter.call(field.content, row, col)
end