Class: GmailBritta::FilterSet::Delegate
- Inherits:
-
Object
- Object
- GmailBritta::FilterSet::Delegate
- 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
-
#filter { ... } ⇒ Filtere
Create, register and return a new GmailBritta::Filter without any merged conditions.
-
#initialize(britta, options = {}) ⇒ Delegate
constructor
private
A new instance of Delegate.
-
#perform {|| ... } ⇒ Object
private
Evaluate the GmailBritta::FilterSet definition block with the Delegate object as
self
.
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, ={}) @britta = britta @log = [:logger] @filter = nil end |
Instance Method Details
#filter { ... } ⇒ Filtere
Create, register and return a new GmailBritta::Filter without any merged conditions
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.
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
73 74 75 |
# File 'lib/gmail-britta/filter_set.rb', line 73 def perform(&block) instance_eval(&block) end |