Sha256: f742a8d69ab16b9baee0eab42ca1fa8b2029ba946160116c77234bbeb631975c

Contents?: true

Size: 744 Bytes

Versions: 9

Compression:

Stored size: 744 Bytes

Contents

# encoding: utf-8

module TTY
  class Table
    module Operation
      # A class responsible for transforming table field
      #
      # @api private
      class Filter
        # Initialize a Filter
        #
        # @api public
        def initialize(filter)
          @filter = filter
        end

        # Apply filer to the provided table field
        #
        # @param [TTY::Table::Field] field
        #
        # @param [Integer] row
        #   the field row index
        #
        # @param [Integer] col
        #   the field column index
        #
        # @api public
        def call(field, row, col)
          @filter.call(field.content, row, col)
        end
      end # Filter
    end # Operation
  end # Table
end # TTY

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tty-table-0.10.0 lib/tty/table/operation/filter.rb
tty-table-0.9.0 lib/tty/table/operation/filter.rb
tty-table-0.8.0 lib/tty/table/operation/filter.rb
tty-table-0.7.0 lib/tty/table/operation/filter.rb
tty-table-0.6.0 lib/tty/table/operation/filter.rb
tty-table-0.5.0 lib/tty/table/operation/filter.rb
tty-table-0.4.0 lib/tty/table/operation/filter.rb
tty-table-0.3.0 lib/tty/table/operation/filter.rb
tty-table-0.2.0 lib/tty/table/operation/filter.rb