]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: add shortcut for retrieving elements
authorEric Wong <normalperson@yhbt.net>
Fri, 4 Apr 2014 23:31:46 +0000 (23:31 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 5 Apr 2014 06:55:35 +0000 (06:55 +0000)
Hopefully this makes for less ad-hoc hash access in case
our config format changes.

lib/PublicInbox/Config.pm

index 9ba4ad32901f501d011c6a88f531914471d98e09..b13e5cecdeb79ef0b1861577b886448fec4ccbf2 100644 (file)
@@ -38,6 +38,12 @@ sub lookup {
        \%rv;
 }
 
+sub get {
+       my ($self, $listname, $key) = @_;
+
+       $self->{"publicinbox.$listname.$key"};
+}
+
 sub default_file {
        my $f = $ENV{PI_CONFIG};
        return $f if defined $f;