CSS::SAC::Condition::Lang - SAC LangConditions


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

Index


Code Index:

NAME

Top

CSS::SAC::Condition::Lang - SAC LangConditions

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::Lang->new($type,$lang)
* $cond->new($type,$lang)

Creates a new lang condition.

* $ccond->Lang([$lang])

get/set the condition's lang

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

package CSS::SAC::Condition::Lang;
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(
                                                _lang_
                                              )],
                                  };
#---------------------------------------------------------------------#




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


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

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

    # add our fields
    $ccond->[_lang_] = $lang if $lang;

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


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



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

# aliases
*CSS::SAC::Condition::Lang::getLang = \&Lang;

#---------------------------------------------------------------------#
# my $lang = $lcond->Lang()
# $lcond->Lang($lang)
# get/set the condition's lang
#---------------------------------------------------------------------#
sub Lang {
    (@_==2) ? $_[0]->[_lang_] = $_[1] :
              $_[0]->[_lang_];
}
#---------------------------------------------------------------------#


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



1;