aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-26 07:53:25 +0200
committerPatrick Spek <p.spek@tyil.nl>2023-07-25 02:16:10 +0200
commit27ec5c4714067fb182d58e8bc9135d25d35a1340 (patch)
tree4f46c7db7ea84a59c90c1aa27289e448aed4cb38 /lib
parentee262705e8193863cb7dfcf421c30609930cc428 (diff)
Add a .clear() to clear the config
Diffstat (limited to 'lib')
-rw-r--r--lib/Config.pm67
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Config.pm6 b/lib/Config.pm6
index 372eb3b..d07c640 100644
--- a/lib/Config.pm6
+++ b/lib/Config.pm6
@@ -16,6 +16,13 @@ class Config is export
has $!path;
has $!parser;
+ method clear()
+ {
+ $!content = {};
+ $!path = "";
+ $!parser = "";
+ }
+
multi method get(Str $key, Any $default = Nil)
{
my $index = $!content;