/[cvs]/nfo/perl/libs/Data/Storage/Locator.pm
ViewVC logotype

Contents of /nfo/perl/libs/Data/Storage/Locator.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Sun Nov 17 06:24:28 2002 UTC (21 years, 7 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +22 -3 lines
+ deep merge of arguments in case of ref HASH

1 #################################
2 #
3 # $Id: Locator.pm,v 1.2 2002/10/17 00:06:16 joko Exp $
4 #
5 # $Log: Locator.pm,v $
6 # Revision 1.2 2002/10/17 00:06:16 joko
7 # + advanced constructor argument shift-in
8 #
9 # Revision 1.1 2002/10/10 03:43:53 cvsjoko
10 # + new
11 #
12 #
13 #################################
14
15 package Data::Storage::Locator;
16
17 use strict;
18 use warnings;
19
20 # get logger instance
21 my $logger = Log::Dispatch::Config->instance;
22
23 use Data::Dumper;
24
25
26 sub new {
27 my $invocant = shift;
28 my $class = ref($invocant) || $invocant;
29
30 # get constructor arguments
31 my @args = ();
32 @_ && (@args = @_);
33 $logger->debug( __PACKAGE__ . "->new( @args )" );
34
35 my $self = {};
36 bless $self, $class;
37
38 #print "dump: ", Dumper(@_), "\n";
39 #my $self = { @_ };
40 foreach (@_) {
41 my $elem = $_;
42 if (ref($elem) eq 'HASH') {
43 foreach (keys %$elem) {
44 $self->{$_} = $elem->{$_};
45 }
46 }
47 }
48
49 return $self;
50 }
51
52 sub native {
53 my $self = shift;
54 my $arg = shift;
55 if ($arg) {
56 $self->{native} = $arg;
57 #$self->_native2abstract();
58 } else {
59 return $self->{native};
60 }
61 }
62
63 sub _native2abstract {
64 my $self = shift;
65
66 }
67
68 sub _abstract2native {
69 my $self = shift;
70 }
71
72 1;

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed