mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Functionality to retrieve all sample values
This commit is contained in:
parent
c73af72c7f
commit
62549aae88
1 changed files with 11 additions and 0 deletions
|
@ -37,6 +37,13 @@ module Spectator::Internals
|
|||
get_wrapper(id).as(TypedValueWrapper(T)).value
|
||||
end
|
||||
|
||||
# Iterates over all values and yields them.
|
||||
def each
|
||||
@values.each_value do |entry|
|
||||
yield entry
|
||||
end
|
||||
end
|
||||
|
||||
# Represents a single value in the set.
|
||||
private struct Entry
|
||||
# Human-friendly name for the value.
|
||||
|
@ -49,5 +56,9 @@ module Spectator::Internals
|
|||
def initialize(@name, @wrapper)
|
||||
end
|
||||
end
|
||||
|
||||
# This must be after `Entry` is defined.
|
||||
# Could be a Cyrstal compiler bug?
|
||||
include Enumerable(Entry)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue