shard-spectator/src/spectator/composite_node_filter.cr
Michael Miller aa81f1d948
Change ExampleFilter to a NodeFilter
Node filters may operate on example groups as well as examples.
2021-08-08 12:13:59 -06:00

16 lines
364 B
Crystal

require "./node_filter"
module Spectator
# Filter that combines multiple other filters.
class CompositeNodeFilter < NodeFilter
# Creates the example filter.
def initialize(@filters : Array(NodeFilter))
end
# Checks whether the node satisfies the filter.
def includes?(node) : Bool
@filters.any?(&.includes?(node))
end
end
end