mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Override === to call includes?
Allows the use of a filter in pattern matching scenarios (select).
This commit is contained in:
parent
e7c3d8f060
commit
f2459cfe94
1 changed files with 5 additions and 0 deletions
|
@ -5,5 +5,10 @@ module Spectator
|
|||
abstract class ExampleFilter
|
||||
# Checks if an example is in the filter, and should be run.
|
||||
abstract def includes?(example : Example) : Bool
|
||||
|
||||
# :ditto:
|
||||
def ===(example : Example)
|
||||
includes?(example)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue