Add #get_value method to automatically cast

This commit is contained in:
Michael Miller 2018-10-22 11:08:55 -06:00
parent 3382084f03
commit f8fa3e706d
1 changed files with 4 additions and 0 deletions

View File

@ -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