Class: GmailBritta::FilterSet::Delegate

Inherits:
Object
  • Object
show all
Defined in:
lib/gmail-britta/filter_set.rb

Overview

A class whose sole purpose it is to be the self in a GmailBritta::FilterSet definition block.

Instance Method Summary collapse

Constructor Details

#initialize(britta, options = {}) ⇒ Delegate

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

Returns a new instance of Delegate.



56
57
58
59
60
# File 'lib/gmail-britta/filter_set.rb', line 56

def initialize(britta, options={})
  @britta = britta
  @log = options[:logger]
  @filter = nil
end

Instance Method Details

#filter { ... } ⇒ Filtere

Create, register and return a new GmailBritta::Filter without any merged conditions

Yields:

Returns:

  • (Filtere)

    the new filter.



65
66
67
# File 'lib/gmail-britta/filter_set.rb', line 65

def filter(&block)
  GmailBritta::Filter.new(@britta, :log => @log).perform(&block)
end

#perform {|| ... } ⇒ Object

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

Note:

this method will typically only be called by GmailBritta::FilterSet#rules

Evaluate the GmailBritta::FilterSet definition block with the GmailBritta::FilterSet::Delegate object as self

Yields:

  • ()

    that filterset definition block



73
74
75
# File 'lib/gmail-britta/filter_set.rb', line 73

def perform(&block)
  instance_eval(&block)
end