Method: Axlsx::Filters::DateGroupItem#initialize

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

#initialize(options = {}) ⇒ DateGroupItem

Creates a new DateGroupItem instanciating the object filter should apply for grouping

Parameters:

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

    A hash of options to use when

  • [String] (Hash)

    a customizable set of options

  • [Integer|String] (Hash)

    a customizable set of options

  • [Integer] (Hash)

    a customizable set of options

Raises:

  • (ArgumentError)


148
149
150
151
152
# File 'lib/axlsx/workbook/worksheet/auto_filter/filters.rb', line 148

def initialize(options={})
  raise ArgumentError,  "You must specify a year for date time grouping" unless options[:year]
  raise ArgumentError, "You must specify a date_time_grouping when creating a DateGroupItem for auto filter" unless options[:date_time_grouping]
  parse_options options
end