CSS::SAC::Condition::Content - SAC ContentConditions


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

Index


Code Index:

NAME

Top

CSS::SAC::Condition::Content - SAC ContentConditions

SYNOPSIS

Top

 see CSS::SAC::Condition

DESCRIPTION

Top

This is a subclass of CSS::SAC::Condition, look there for more documentation. This class adds the following methods (the spec equivalents are available as well, just prepend 'get'):

METHODS

Top

* CSS::SAC::Condition::Content->new($type,$data)
* $cond->new($type,$data)

Creates a new content condition.

* $ccond->Data([$data])

get/set the condition's data

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::Condition::Content - SAC ContentConditions
# Robin Berjon <robin@knowscape.com>
# 24/02/2001
###

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

use base qw(CSS::SAC::Condition);


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




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


#---------------------------------------------------------------------#
# CSS::SAC::Condition::Content->new($type,$data)
# creates a new sac ContentCondition object
#---------------------------------------------------------------------#
sub new {
    my $class = ref($_[0])?ref(shift):shift;
    my $type = shift; # should be one of the content conditions
    my $data = shift;

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

    # add our fields
    $ccond->[_data_] = $data if defined $data;

    return $ccond;
}
#---------------------------------------------------------------------#


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



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

# aliases
*CSS::SAC::Condition::Content::getData = \&Data;

#---------------------------------------------------------------------#
# my $data = $ccond->Data()
# $ccond->Data($data)
# get/set the condition's data
#---------------------------------------------------------------------#
sub Data {
    (@_==2) ? $_[0]->[_data_] = $_[1] :
              $_[0]->[_data_];
}
#---------------------------------------------------------------------#


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



1;