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.
8 9 10 |
# File 'lib/rshade/filter/include_path_filter.rb', line 8 def initialize @paths = [] end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
4 5 6 |
# File 'lib/rshade/filter/include_path_filter.rb', line 4 def paths @paths end |
Instance Method Details
#call(event) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/rshade/filter/include_path_filter.rb', line 20 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
29 30 31 |
# File 'lib/rshade/filter/include_path_filter.rb', line 29 def config_call(&block) block.call(@paths) end |
#name ⇒ Object
12 13 14 |
# File 'lib/rshade/filter/include_path_filter.rb', line 12 def name NAME end |
#priority ⇒ Object
16 17 18 |
# File 'lib/rshade/filter/include_path_filter.rb', line 16 def priority 1 end |