Permalink
Browse files

setParent now does parameters checks for either Root or that it's a T…

…ree::Simple obj
  • Loading branch information...
Takadonet committed Dec 14, 2010
1 parent 0008c4b commit e077d0b2ac6e0b8ba1296259b925cfd213dfe119
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/Tree/Simple.pm
View
@@ -66,13 +66,8 @@ multi method new($node,$parent){
}
-#believe parameter check would be Tree::Simple
#also should be private but cannot modify others setParent
-method setParent($parent) {
-# my ($self, $parent) = @_;
-# (defined($parent) &&
-# (($parent eq $self->ROOT) || (blessed($parent) && $parent->isa("Tree::Simple"))))
-# || die "Insufficient Arguments : parent also must be a Tree::Simple object";
+method setParent($parent where { $parent eq $Tree::Simple::ROOT || $parent ~~ Tree::Simple}) {
$.parent = $parent;
if ($parent eq $ROOT) {
$.depth = -1;

0 comments on commit e077d0b

Please sign in to comment.