Class: GmailBritta::ChainingFilter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ ChainingFilter

Returns a new instance of ChainingFilter


6
7
8
9
# File 'lib/gmail-britta/chaining_filter.rb', line 6

def initialize(parent)
  @parent = parent
  super(parent.filterset, :log => parent.logger)
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent


3
4
5
# File 'lib/gmail-britta/chaining_filter.rb', line 3

def parent
  @parent
end

Instance Method Details

#ensure_merged_with_parentObject


24
25
26
27
28
29
# File 'lib/gmail-britta/chaining_filter.rb', line 24

def ensure_merged_with_parent
  unless merged?
    @merged = true
    perform_merge(@parent)
  end
end

#generate_xmlObject


11
12
13
14
# File 'lib/gmail-britta/chaining_filter.rb', line 11

def generate_xml
  ensure_merged_with_parent
  super
end

#log_definitionObject

TODO: Maybe just extend #perform to merge after it's done.


17
18
19
20
21
22
# File 'lib/gmail-britta/chaining_filter.rb', line 17

def log_definition
  return unless @log.debug?

  ensure_merged_with_parent
  super
end

#merged?Boolean

Returns:

  • (Boolean)

4
# File 'lib/gmail-britta/chaining_filter.rb', line 4

def merged?; @merged ; end