Test-Ranger

 view release on metacpan or  search on metacpan

lib/Test/Ranger.pm  view on Meta::CPAN

# If invoked with $class and an arrayref, invokes ::List::new(). 
# 
sub new {
    my $class   = shift;
    my $self    = shift || {};      # default: hashref
    
    if ( (reftype $self)->array ) {
        $self       = Test::Ranger::List->new($self);
    } 
    else {
        bless ($self => $class);
        $self->init();
    };
    
    return $self;
}; ## new

#=========# OBJECT METHOD
#
#   $obj->init();
#

lib/Test/Ranger/List.pm  view on Meta::CPAN

# But it is constructed by passing in an arrayref. 
# An empty hashref is blessed into $class. 
# Each element of @list is blessed into Test::Ranger in init(). 
# Housekeeping info for the whole object is stored in other keys. 
# 
sub new {
    my $class   = shift;
    my @list    = @{ shift() };
    my $self    = {};
    
    bless ($self => $class);
    $self->init(@list);
    
    return $self;
}; ## new

#=========# OBJECT METHOD
#
#   $self->init( @list );
# 
# Purpose   : Object initializer



( run in 0.236 second using v1.01-cache-2.11-cpan-94b05bcf43c )