mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use Iterable(Node) instead of ExampleGroup
This commit is contained in:
parent
aa81f1d948
commit
3803d4582c
1 changed files with 2 additions and 3 deletions
|
@ -1,5 +1,4 @@
|
||||||
require "./example"
|
require "./example"
|
||||||
require "./example_group"
|
|
||||||
require "./node"
|
require "./node"
|
||||||
|
|
||||||
module Spectator
|
module Spectator
|
||||||
|
@ -13,7 +12,7 @@ module Spectator
|
||||||
|
|
||||||
# Creates a new iterator.
|
# Creates a new iterator.
|
||||||
# The *group* is the example group to iterate through.
|
# The *group* is the example group to iterate through.
|
||||||
def initialize(@group : ExampleGroup)
|
def initialize(@group : Iterable(Node))
|
||||||
iter = @group.each.as(Iterator(Node))
|
iter = @group.each.as(Iterator(Node))
|
||||||
@stack = [iter]
|
@stack = [iter]
|
||||||
end
|
end
|
||||||
|
@ -55,7 +54,7 @@ module Spectator
|
||||||
# Get the iterator from the top of the stack.
|
# Get the iterator from the top of the stack.
|
||||||
# Advance the iterator and check what the next item is.
|
# Advance the iterator and check what the next item is.
|
||||||
case (item = top.next)
|
case (item = top.next)
|
||||||
when ExampleGroup
|
when Iterable(Node)
|
||||||
# If the next thing is a group,
|
# If the next thing is a group,
|
||||||
# we need to traverse its branch.
|
# we need to traverse its branch.
|
||||||
# Push its iterator onto the stack and return.
|
# Push its iterator onto the stack and return.
|
||||||
|
|
Loading…
Reference in a new issue