/[papo]/papo/neb/neb/Tree/Container.pm
ViewVC logotype

Diff of /papo/neb/neb/Tree/Container.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jlenton, Wed Apr 9 19:59:22 2003 UTC revision 1.4 by jlenton, Wed Apr 9 23:52:49 2003 UTC
# Line 1  Line 1 
1  package neb::Tree::Container;  package neb::Tree::Container;
2  use strict;  use strict;
 use Carp;  
3  use neb::Tree::Node;  use neb::Tree::Node;
4  our @ISA = ('neb::Tree::Node');  our @ISA = ('neb::Tree::Node');
5    
6  sub init  sub init
7  {  {
8      my $self = shift;      my $self = shift;
9        my $location = shift;
10    
11        $self->location($location)
12            if defined($location);
13    
14      $self->{CONTENT} = [];      $self->{CONTENT} = [];
15  }  }
16    
17    sub url
18    {
19        my $self = shift;
20    
21        return $self->location;
22    }
23    
24    
25  sub add_content  sub add_content
26  {  {
27      my $self = shift;      my $self = shift;
28      my $content = shift;      my $content = shift;
29    
30        $content->location($self->url);
31    
32      push @{$self->{CONTENT}}, $content;      push @{$self->{CONTENT}}, $content;
33      return @{$self->{CONTENT}};      return @{$self->{CONTENT}};
34  }  }
# Line 40  sub remove Line 54  sub remove
54  sub content  sub content
55  {  {
56      my $self = shift;      my $self = shift;
57      $self->{CONTENT} = [ @_ ]  
58          if (@_);      if (@_)
59        {    
60            $self->{CONTENT} = [ @_ ];
61            warn 'Agregando contenido en bloque';
62        }
63    
64      return wantarray ? @{$self->{CONTENT}} : $self->{CONTENT};      return wantarray ? @{$self->{CONTENT}} : $self->{CONTENT};
65  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26