cvs commit: p5ee/App-Context/lib/App SessionObject.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/08/09 12:05:03

  Modified:    App-Context/lib/App SessionObject.pm
  Log:
  change containment separator from . to -
  
  Revision  Changes    Path
  1.7       +66 -3     p5ee/App-Context/lib/App/SessionObject.pm
  
  Index: SessionObject.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Context/lib/App/SessionObject.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SessionObject.pm	14 Mar 2005 17:37:04 -0000	1.6
  +++ SessionObject.pm	9 Aug 2005 19:05:02 -0000	1.7
  @@ -167,7 +167,7 @@
       $name               = $self->{name};
       $absorbable_attribs = $self->absorbable_attribs();
       $container          = "default";
  -    if ($name =~ /^(.+)\.[a-zA-Z][a-zA-Z0-9_]*$/) {
  +    if ($name =~ /^(.+)-[a-zA-Z][a-zA-Z0-9_]*$/) {
           $container = $1;
       }
   
  @@ -218,6 +218,69 @@
   =cut
   
   #############################################################################
  +# Method: container()
  +#############################################################################
  +
  +=head2 container()
  +
  +    * Signature: $self->container();
  +    * Signature: $self->container($name);
  +    * Params:    $name      string
  +    * Throws:    App::Exception
  +    * Since:     0.01
  +
  +    $container = $session_object->container();
  +
  +=cut
  +
  +sub container {
  +    &App::sub_entry if ($App::trace);
  +    my ($self, $name) = @_;
  +    $name ||= $self->{name};
  +    my ($container);
  +    if ($name =~ /^(.+)-[a-zA-Z][a-zA-Z0-9_]*$/) {
  +        $container = $1;
  +    }
  +    else {
  +        $container = "default";
  +    }
  +    &App::sub_exit($container) if ($App::trace);
  +    return($container);
  +}
  +
  +#############################################################################
  +# Method: container_attrib()
  +#############################################################################
  +
  +=head2 container_attrib()
  +
  +    * Signature: $attrib = $self->container_attrib();
  +    * Signature: $attrib = $self->container_attrib($name);
  +    * Params:    $name      string
  +    * Returns:   $attrib    string
  +    * Throws:    App::Exception
  +    * Since:     0.01
  +
  +    $attrib = $session_object->container_attrib();
  +
  +=cut
  +
  +sub container_attrib {
  +    &App::sub_entry if ($App::trace);
  +    my ($self, $name) = @_;
  +    $name ||= $self->{name};
  +    my ($attrib);
  +    if ($name =~ /^.+-([a-zA-Z][a-zA-Z0-9_]*)$/) {
  +        $attrib = $1;
  +    }
  +    else {
  +        $attrib = $name;
  +    }
  +    &App::sub_exit($attrib) if ($App::trace);
  +    return($attrib);
  +}
  +
  +#############################################################################
   # Method: handle_event()
   #############################################################################
   
  @@ -249,7 +312,7 @@
           my $name = $self->{name};
           my $context = $self->{context};
           my $container = "default";
  -        if ($name =~ /^(.+)\.[a-zA-Z][a-zA-Z0-9_]*$/) {
  +        if ($name =~ /^(.+)-[a-zA-Z][a-zA-Z0-9_]*$/) {
               $container = $1;
           }
           else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.