diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-12-29 01:06:47 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-12-29 01:06:47 -0600 |
commit | 2674cfd2e9ff7a8b4f2952a5f84e94804afc3a1f (patch) | |
tree | 201c69c8532c720b254161fdc77c0cf0f4e3c3d4 /lib/Bread/Board.pm | |
parent | 8761aaac596dfd3fe595584aa44720084ccec2eb (diff) | |
download | p6-bread-board-2674cfd2e9ff7a8b4f2952a5f84e94804afc3a1f.tar.gz p6-bread-board-2674cfd2e9ff7a8b4f2952a5f84e94804afc3a1f.zip |
add a bit more api to the singleton instance
Diffstat (limited to 'lib/Bread/Board.pm')
-rw-r--r-- | lib/Bread/Board.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Bread/Board.pm b/lib/Bread/Board.pm index 82b886c..c741757 100644 --- a/lib/Bread/Board.pm +++ b/lib/Bread/Board.pm @@ -406,15 +406,20 @@ class Container does Traversable { role Singleton does Lifecycle is export { has $!instance; - has Bool $!has_instance; + has Bool $.has_instance; method get { - if !$!has_instance { + if !$.has_instance { $!instance = callsame; $!has_instance = True; } return $!instance; } + + method flush_instance { + $!instance = Any; + $!has_instance = False; + } } our $CC; |