Class: RShade::Filter::IncludePathFilter
- Inherits:
-
AbstractFilter
- Object
- AbstractFilter
- RShade::Filter::IncludePathFilter
- Defined in:
- lib/rshade/filter/include_path_filter.rb
Direct Known Subclasses
Constant Summary collapse
- NAME =
:include_paths
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
- #call(event) ⇒ Object
- #config_call(&block) ⇒ Object
-
#initialize ⇒ IncludePathFilter
constructor
A new instance of IncludePathFilter.
- #name ⇒ Object
- #priority ⇒ Object
Methods inherited from AbstractFilter
Constructor Details
#initialize ⇒ IncludePathFilter
Returns a new instance of IncludePathFilter.
10 11 12 13 |
# File 'lib/rshade/filter/include_path_filter.rb', line 10 def initialize super @paths = [] end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
6 7 8 |
# File 'lib/rshade/filter/include_path_filter.rb', line 6 def paths @paths end |
Instance Method Details
#call(event) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/rshade/filter/include_path_filter.rb', line 23 def call(event) event_path = event.path paths.any? do |path| next str?(path, event_path) if path.is_a? String next regexp?(path, event_path) if path.is_a? Regexp false end end |
#config_call(&block) ⇒ Object
33 34 35 |
# File 'lib/rshade/filter/include_path_filter.rb', line 33 def config_call(&block) block.call(@paths) end |
#name ⇒ Object
15 16 17 |
# File 'lib/rshade/filter/include_path_filter.rb', line 15 def name NAME end |
#priority ⇒ Object
19 20 21 |
# File 'lib/rshade/filter/include_path_filter.rb', line 19 def priority 1 end |