Module: GmailBritta

Defined in:
lib/gmail-britta.rb,
lib/gmail-britta/filter.rb,
lib/gmail-britta/filter_set.rb,
lib/gmail-britta/chaining_filter.rb,
lib/gmail-britta/single_write_accessors.rb

Overview

A generator DSL for importable gmail filter specifications.

This is the main entry point for defining a filter set (multiple filters). See GmailBritta.filterset for details.

Defined Under Namespace

Modules: SingleWriteAccessors Classes: ChainingFilter, Filter, FilterSet, NegatedChainingFilter, PositiveChainingFilter

Class Method Summary collapse

Class Method Details

.filterset(opts = {}) { ... } ⇒ FilterSet

Create a FilterSet and run the filter set definition in the block. This is the main entry point for GmailBritta.

Parameters:

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

    a customizable set of options

Options Hash (opts):

  • :me (Array<String>)

    A list of email addresses that should be considered as belonging to "you", effectively those email addresses you would expect to:me to match.

  • :logger (Logger) — default: Logger.new()

    An initialized logger instance.

Yields:

  • the filterset definition block. self inside the block is the FilterSet instance.

Returns:


30
31
32
33
# File 'lib/gmail-britta.rb', line 30

def self.filterset(opts={}, &block)
  (britta = FilterSet.new(opts)).rules(&block)
  britta
end