Class: Evilution::AST::Pattern::Filter
- Inherits:
-
Object
- Object
- Evilution::AST::Pattern::Filter
- Defined in:
- lib/evilution/ast/pattern/filter.rb
Instance Attribute Summary collapse
-
#skipped_count ⇒ Object
readonly
Returns the value of attribute skipped_count.
Instance Method Summary collapse
-
#initialize(patterns) ⇒ Filter
constructor
A new instance of Filter.
- #reset_count! ⇒ Object
- #skip?(node) ⇒ Boolean
Constructor Details
Instance Attribute Details
#skipped_count ⇒ Object (readonly)
Returns the value of attribute skipped_count.
6 7 8 |
# File 'lib/evilution/ast/pattern/filter.rb', line 6 def skipped_count @skipped_count end |
Instance Method Details
#reset_count! ⇒ Object
22 23 24 |
# File 'lib/evilution/ast/pattern/filter.rb', line 22 def reset_count! @skipped_count = 0 end |
#skip?(node) ⇒ Boolean
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 |