/[webpac2]/trunk/lib/WebPAC/Config.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Config.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 681 by dpavlin, Sun Sep 24 15:28:49 2006 UTC revision 682 by dpavlin, Sun Sep 24 15:28:54 2006 UTC
# Line 89  sub use_indexer { Line 89  sub use_indexer {
89          return $self->{config}->{use_indexer} || $default;          return $self->{config}->{use_indexer} || $default;
90  }  }
91    
92    =head2 get
93    
94      $config->get('top-level_key');
95    
96    =cut
97    
98    sub get {
99            my $self = shift;
100            my $what = shift || return;
101            return $self->{config}->{$what};
102    }
103    
104    =head2 webpac
105    
106    Return C<< config -> webpac >> parts
107    
108      my @supported_inputs = $config->webpac('inputs');
109      my $inputs_hash = $config->webpac('inputs');
110    
111    =cut
112    
113    sub webpac {
114            my $self = shift;
115    
116            $self->_get_logger()->logdie("can't find config->webpac") unless defined( $self->{config}->{webpac} );
117    
118            my $what = shift || return $self->{config}->{webpac};
119    
120            if (wantarray) {
121                    return keys %{ $self->{config}->{webpac}->{$what} };
122            } else {
123                    return $self->{config}->{webpac}->{$what};
124            }
125    
126    }
127    
128  =head1 AUTHOR  =head1 AUTHOR
129    
130  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>

Legend:
Removed from v.681  
changed lines
  Added in v.682

  ViewVC Help
Powered by ViewVC 1.1.26