mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Simplify get method
This commit is contained in:
parent
3e4b77da77
commit
4108a6602d
1 changed files with 2 additions and 2 deletions
|
@ -11,9 +11,9 @@ module Spectator
|
|||
# On the first invocation of this method, it will yield.
|
||||
# The block should return the value to store.
|
||||
# Subsequent calls will return the same value and not yield.
|
||||
def get(type : T.class, &block : -> T) : T forall T
|
||||
def get(&block : -> T) : T forall T
|
||||
wrapper = @lazy.get { Wrapper.new(yield) }
|
||||
wrapper.get(type)
|
||||
wrapper.get(T)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue