Have Setting's get work like other gets by returning a hashref when

no param is requested.
This commit is contained in:
Colin Kuskie 2009-03-30 19:46:16 +00:00
parent 8d61c288e7
commit 05d62c92b7
2 changed files with 15 additions and 5 deletions

View file

@ -87,16 +87,25 @@ sub DESTROY {
#-------------------------------------------------------------------
=head2 get ( )
=head2 get ( $param )
Returns a hash reference containing all the settings.
=head3 $param
If $param is defined, then it will return only the setting for that param.
=cut
sub get {
my $self = shift;
my $param = shift;
return $self->{_settings}{$param};
my $self = shift;
my $param = shift;
if (defined $param) {
return $self->{_settings}{$param};
}
else {
return $self->{_settings};
}
}