Method: Axlsx::FilterColumn#initialize

Defined in:
lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb

#initialize(col_id, filter_type, options = {}) {|@filter| ... } ⇒ FilterColumn

Note:

This class yields its filter object as that is where the vast majority of processing will be done

Creates a new FilterColumn object

Parameters:

  • col_id (Integer|Cell)

    The zero based index for the column to which this filter will be applied

  • filter_type (Symbol)

    The symbolized class name of the filter to apply to this column.

  • options (Hash) (defaults to: {})

    options for this object and the filter

  • [Boolean] (Hash)

    a customizable set of options

Yields:



19
20
21
22
23
24
25
26
# File 'lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb', line 19

def initialize(col_id, filter_type, options = {})
  RestrictionValidator.validate 'FilterColumn.filter', FILTERS, filter_type
  # Axlsx::validate_unsigned_int(col_id)
  self.col_id = col_id
  parse_options options
  @filter = Axlsx.const_get(Axlsx.camel(filter_type)).new(options)
  yield @filter if block_given?
end