Test-Ranger

 view release on metacpan or  search on metacpan

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

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 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

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 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 1.455 second using v1.01-cache-2.11-cpan-94b05bcf43c )