--- nfo/perl/libs/Data/Query.pm 2002/12/23 04:23:24 1.1 +++ nfo/perl/libs/Data/Query.pm 2002/12/27 16:02:39 1.2 @@ -1,7 +1,12 @@ ## -------------------------------------------------------------------------------- -## $Id: Query.pm,v 1.1 2002/12/23 04:23:24 joko Exp $ +## $Id: Query.pm,v 1.2 2002/12/27 16:02:39 joko Exp $ ## -------------------------------------------------------------------------------- ## $Log: Query.pm,v $ +## Revision 1.2 2002/12/27 16:02:39 joko +## - object constructor +## + now utilizing DesignPattern::Object +## + use Data::Query::Element::LV +## ## Revision 1.1 2002/12/23 04:23:24 joko ## + initial check-in ## @@ -13,6 +18,7 @@ use strict; use warnings; +use base 'DesignPattern::Object'; use base 'DesignPattern::Object::Logger'; @@ -22,34 +28,26 @@ use libp qw( mkObject ); use Data::Compare::Struct qw( isEmpty ); -# ------------ common perl object constructor ------------ -sub new { - my $invocant = shift; - my $class = ref($invocant) || $invocant; - my @args = (); - @_ && (@args = @_); - #$logger->debug( __PACKAGE__ . "->new( @args )" ); # this is not "common"! - my $self = { @_ }; - bless $self, $class; - $self->{caller} = caller; - - #print Dumper(caller(2)); - #exit; - - $self->_init(); - return $self; -} +use Data::Query::Element::LV; sub _init { my $self = shift; - #print Dumper($self->{options}->getOptions()); + if ($self->{options}) { + $self->{__options} = $self->{options}; + delete $self->{options}; + my $possible_keys = $self->{__options}->getPossibleOptionKeys(); + my $options = $self->{__options}->getOptions(); + foreach (@$possible_keys) { + $self->{$_} = Data::Query::Element::LV->new($options->{$_}); + } + } } sub getOptions { my $self = shift; - return $self->{options}->getOptions(); + return $self->{__options}->getOptions(); } 1; \ No newline at end of file