Class: Tracing::BaseFilter

Inherits:
Object show all
Defined in:
lib/filters/filter.rb

Overview

abstract filter

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ BaseFilter

Returns a new instance of BaseFilter.



26
27
28
# File 'lib/filters/filter.rb', line 26

def initialize(options = {})
  @name = options[:name] || "Unknown filter"      
end

Class Attribute Details

.filtersObject

Returns the value of attribute filters.



8
9
10
# File 'lib/filters/filter.rb', line 8

def filters
  @filters
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/filters/filter.rb', line 4

def name
  @name
end

#rulesObject

Returns the value of attribute rules.



5
6
7
# File 'lib/filters/filter.rb', line 5

def rules
  @rules
end

Class Method Details

.register_filters(hash) ⇒ Object

register symbol => filter mappings



11
12
13
14
15
16
# File 'lib/filters/filter.rb', line 11

def register_filters(hash)
  # puts "register_filters: #{hash.inspect}"
  @filters ||= {}        
  @filters.merge!(hash)
  return @filters
end

.unregister_filters(hash) ⇒ Object

array of symbols

:special_filter, :stream_filter


20
21
22
23
# File 'lib/filters/filter.rb', line 20

def unregister_filters(hash)
  @filters ||= {}
  filters.reject!{|key, value| hash.include? key}
end

Instance Method Details

#name_allow_action(name) ⇒ Object



30
31
32
33
# File 'lib/filters/filter.rb', line 30

def name_allow_action(name)
  puts "name_allow_action: #{name}"
  # res = rules.rules_allow_action(name)
end