mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
16 lines
364 B
Crystal
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
|