[libcatmandu-perl] 18/30: Store bags method

Jonas Smedegaard dr at jones.dk
Tue Dec 19 11:10:13 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/1.0700-1
in repository libcatmandu-perl.

commit f659c1f6c2e4d1e22ed7bdc0342aa3fe639172fa
Author: Nicolas Steenlant <nicolas.steenlant at ugent.be>
Date:   Mon Oct 23 14:34:57 2017 +0200

    Store bags method
---
 Changes               | 1 +
 lib/Catmandu/Store.pm | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 1590d8a..ff09626 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,7 @@ Revision history for Catmandu
 
 {{$NEXT}}
   - new DKVP importer for delimited key-value pairs
+  - new Store bags method
   - new Store default_options for bag
 
 1.0606  2017-09-26 10:42:35 CEST
diff --git a/lib/Catmandu/Store.pm b/lib/Catmandu/Store.pm
index 03c4648..b1c06e2 100644
--- a/lib/Catmandu/Store.pm
+++ b/lib/Catmandu/Store.pm
@@ -54,10 +54,15 @@ sub new_bag {
 {
     fieldhash my %bag_instances;
 
+    sub bags {
+        my ($self) = @_;
+        $bag_instances{$self} ||= {};
+    }
+
     sub bag {
         my ($self, $name) = @_;
         $name ||= $self->default_bag;
-        $bag_instances{$self}{$name} ||= $self->new_bag($name);
+        $self->bags->{$name} ||= $self->new_bag($name);
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git



More information about the Pkg-perl-cvs-commits mailing list