aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2017-04-26 07:53:25 +0200
committerPatrick Spek <p.spek@tyil.nl>2017-04-26 07:53:25 +0200
commitfd33799e2737e1fcce7b9bad44d0031f8dc9a2c9 (patch)
tree4f46c7db7ea84a59c90c1aa27289e448aed4cb38
parentcac9a5f9e429d2461bd2830bc983eced5ef14e1a (diff)
Add a .clear() to clear the config
-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;