CSS::SAC::Selector::Negative - SAC NegativeSelector


CSS-SAC documentation Contained in the CSS-SAC distribution.

Index


Code Index:

NAME

Top

CSS::SAC::Selector::Negative - SAC NegativeSelector

SYNOPSIS

Top

 see CSS::SAC::Selector

DESCRIPTION

Top

This is a subclass of CSS::SAC::Selector::Simple, look there for more documentation. This class adds the following methods (which also exist in spec style, simply prepend them with 'get'):

METHODS

Top

* CSS::SAC::Selector::Negative->new($type,$sel)
* $nsel->new($type,$sel)

Creates a new negative selector.

* $nsel->SimpleSelector([$sel])

get/set the selector's simple selector

AUTHOR

Top

Robin Berjon <robin@knowscape.com>

This module is licensed under the same terms as Perl itself.


CSS-SAC documentation Contained in the CSS-SAC distribution.

###
# CSS::SAC::Selector::Negative - SAC NegativeSelector
# Robin Berjon <robin@knowscape.com>
# 24/02/2001
###

package CSS::SAC::Selector::Negative;
use strict;
use vars qw($VERSION);
$VERSION = $CSS::SAC::VERSION || '0.03';

use base qw(CSS::SAC::Selector::Simple);


#---------------------------------------------------------------------#
# build the fields for an array based object
#---------------------------------------------------------------------#
use Class::ArrayObjects extend => {
                                   class => 'CSS::SAC::Selector::Simple',
                                   with  => [qw(
                                                _sel_
                                              )],
                                  };
#---------------------------------------------------------------------#




### Constructor #######################################################
#                                                                     #
#                                                                     #


#---------------------------------------------------------------------#
# CSS::SAC::Selector::Negative->new($type,$sel)
# creates a new sac NegativeSelector object
#---------------------------------------------------------------------#
sub new {
    my $class = ref($_[0])?ref(shift):shift;
    my $type = shift;
    my $sel  = shift;

    # create a selector
    my $nsel = $class->SUPER::new($type);

    # add our fields
    $nsel->[_sel_] = $sel;

    return $nsel;
}
#---------------------------------------------------------------------#


#                                                                     #
#                                                                     #
### Constructor #######################################################



### Accessors #########################################################
#                                                                     #
#                                                                     #

*CSS::SAC::Selector::Negative::getSimpleSelector = \&SimpleSelector;

#---------------------------------------------------------------------#
# my $sel = $nsel->SimpleSelector()
# $nsel->SimpleSelector($sel)
# get/set the selector's simple selector
#---------------------------------------------------------------------#
sub SimpleSelector {
    (@_==2) ? $_[0]->[_sel_] = $_[1] :
              $_[0]->[_sel_];
}
#---------------------------------------------------------------------#


#                                                                     #
#                                                                     #
### Accessors #########################################################



1;