mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Simplify #examples and #groups methods
This commit is contained in:
parent
f63f8b15a0
commit
1a61235cdc
1 changed files with 2 additions and 2 deletions
|
@ -17,11 +17,11 @@ module Spectator
|
|||
end
|
||||
|
||||
def examples : Enumerable(Example)
|
||||
children.select { |child| child.is_a?(Example) }.map { |child| child.unsafe_as(Example) }
|
||||
children.compact_map { |child| child.as?(Example) }
|
||||
end
|
||||
|
||||
def groups : Enumerable(ExampleGroup)
|
||||
children.select { |child| child.is_a?(ExampleGroup) }.map { |child| child.unsafe_as(ExampleGroup) }
|
||||
children.compact_map { |child| child.as?(ExampleGroup) }
|
||||
end
|
||||
|
||||
def example_count
|
||||
|
|
Loading…
Reference in a new issue