mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add #get_value method to automatically cast
This commit is contained in:
parent
3382084f03
commit
f8fa3e706d
1 changed files with 4 additions and 0 deletions
|
@ -21,5 +21,9 @@ module Spectator::Internals
|
|||
def get_wrapper(id : Symbol)
|
||||
@values[id].wrapper
|
||||
end
|
||||
|
||||
def get_value(id : Symbol, value_type : T.class) : T forall T
|
||||
get_wrapper(id).as(TypedValueWrapper(T)).value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue