class GmailBritta::FilterSet::Delegate

A class whose sole purpose it is to be the `self` in a {FilterSet} definition block.

Public Class Methods

new(britta, options={}) click to toggle source

@api private

# File lib/gmail-britta/filter_set.rb, line 56
def initialize(britta, options={})
  @britta = britta
  @log = options[:logger]
  @filter = nil
end

Public Instance Methods

filter(&block) click to toggle source

Create, register and return a new {Filter} without any merged conditions @yield [] the {Filter} definition block, with the new {Filter} instance as `self`. @return [Filtere] the new filter.

# File lib/gmail-britta/filter_set.rb, line 65
def filter(&block)
  GmailBritta::Filter.new(@britta, :log => @log).perform(&block)
end
perform(&block) click to toggle source

Evaluate the {FilterSet} definition block with the {Delegate} object as `self` @api private @note this method will typically only be called by {FilterSet#rules} @yield [ ] that filterset definition block

# File lib/gmail-britta/filter_set.rb, line 73
def perform(&block)
  instance_eval(&block)
end