aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2021-03-18 23:56:19 +0100
committerPatrick Spek <p.spek@tyil.nl>2021-03-18 23:56:19 +0100
commiteda41a0ce3ac8cd5ad41791c5d5641c72f7b4bb1 (patch)
tree161ff11425a93c2b54c82d20ffc78a14531777af
parent280463e699d1667111191b8fad4e2821497ca4f5 (diff)
Call own methods with self
-rw-r--r--CHANGELOG.md8
-rw-r--r--lib/Config.rakumod6
2 files changed, 11 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 93fd1ae..eaae2b4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).
+## [UNRELEASED]
+
+### Changed
+
+- Methods now use `self` to call `Config` itself, instead of hardcoding to
+ `Config`. This allows for inheritance with the `Config` class, without
+ breaking its core functionality.
+
## [3.0.3] - 2020-11-16
Due to a user error, version 3.0.2 has been skipped.
diff --git a/lib/Config.rakumod b/lib/Config.rakumod
index cddf256..e896517 100644
--- a/lib/Config.rakumod
+++ b/lib/Config.rakumod
@@ -146,7 +146,7 @@ multi method read (
--> Config:D
) {
- Config.new(
+ self.new(
%!template,
:$!name,
data => merge-hash(%!data.clone, %data),
@@ -252,7 +252,7 @@ multi method set (
$index = $value;
- Config.new(
+ self.new(
%!template,
:$!name,
:%data,
@@ -287,7 +287,7 @@ multi method unset (
$index{@parts[*-1]}:delete;
- Config.new(
+ self.new(
%!template,
:$!name,
:%data,