The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CSS::Object::Selector - CSS Object Oriented Selector

SYNOPSIS

    use CSS::Object::Selector;
    my $sel = CSS::Object::Selector->new(
        name => $css_selector,
        debug => 3,
        format => $format_object
    ) || die( CSS::Object::Selector->error );

VERSION

    v0.1.0

DESCRIPTION

CSS::Object::Selector is a class to contain the name of a selector. For any given css rule, there can be multiple selectors.

Selector objects can be accessed with "selectors" in CSS::Object::Rule which is an Module::Generic::Array object.

CONSTRUCTOR

new

To instantiate a new CSS::Object::Selector object, pass an hash reference of following parameters:

debug

This is an integer. The bigger it is and the more verbose is the output.

format

This is a CSS::Object::Format object or one of its child modules.

name

This is the selector's name. When provided, this calls the method "name" to store the value.

METHODS

add_to

Provided with a CSS::Object::Rule object, and this will add our selector object to it by calling "add_selector" in CSS::Object::Rule

It returns our selector object to allow chaining.

as_string

This returns the selector's name.

Maybe, this should be changed to calling a method selector_as_string in the CSS::Object::Format, but the reasons for modifying a selector's name are limited.

format

This is a CSS::Object::Format object or one of its child modules.

name

Sets or gets the selector's name. The name stored here becomes a Module::Generic::Scalar and thus all its object methods can be used

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

CSS::Object

COPYRIGHT & LICENSE

Copyright (c) 2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.