Class: Evilution::AST::Pattern::Filter Private
- Inherits:
-
Object
- Object
- Evilution::AST::Pattern::Filter
- Defined in:
- lib/evilution/ast/pattern/filter.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #skipped_count ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(patterns) ⇒ Filter
constructor
private
A new instance of Filter.
- #reset_count! ⇒ Object private
- #skip?(node) ⇒ Boolean private
Constructor Details
#initialize(patterns) ⇒ Filter
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 Filter.
8 9 10 11 |
# File 'lib/evilution/ast/pattern/filter.rb', line 8 def initialize(patterns) @matchers = patterns.map { |p| Evilution::AST::Pattern::Parser.new(p).parse } @skipped_count = 0 end |
Instance Attribute Details
#skipped_count ⇒ Object (readonly)
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.
6 7 8 |
# File 'lib/evilution/ast/pattern/filter.rb', line 6 def skipped_count @skipped_count end |
Instance Method Details
#reset_count! ⇒ 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.
22 23 24 |
# File 'lib/evilution/ast/pattern/filter.rb', line 22 def reset_count! @skipped_count = 0 end |
#skip?(node) ⇒ Boolean
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.
13 14 15 16 17 18 19 20 |
# File 'lib/evilution/ast/pattern/filter.rb', line 13 def skip?(node) if @matchers.any? { |m| m.match?(node) } @skipped_count += 1 true else false end end |