| 1 | |||||||||||||
| 2 | ### | ||||||||||||
| 3 | # CSS::SAC::Selector::Negative - SAC NegativeSelector | ||||||||||||
| 4 | # Robin Berjon <robin@knowscape.com> | ||||||||||||
| 5 | # 24/02/2001 | ||||||||||||
| 6 | ### | ||||||||||||
| 7 | |||||||||||||
| 8 | package CSS::SAC::Selector::Negative; | ||||||||||||
| 9 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 2 | ▶ | use vars qw($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 2 | ▶ | $VERSION = $CSS::SAC::VERSION || '0.03'; | ||||||||||
|
Condition50%1/2
$CSS::SAC::VERSION || '0.03'
MC/DC0%0/1
$CSS::SAC::VERSION || '0.03'
$CSS::SAC::VERSION
Truth table50%1/2
A
A= $CSS::SAC::VERSION
| |||||||||||||
| 12 | |||||||||||||
| 13 | 2 | ▶ | use base qw(CSS::SAC::Selector::Simple); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | |||||||||||||
| 16 | #---------------------------------------------------------------------# | ||||||||||||
| 17 | # build the fields for an array based object | ||||||||||||
| 18 | #---------------------------------------------------------------------# | ||||||||||||
| 19 | 2 | ▶ | use Class::ArrayObjects extend => { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | class => 'CSS::SAC::Selector::Simple', | ||||||||||||
| 21 | with => [qw( | ||||||||||||
| 22 | _sel_ | ||||||||||||
| 23 | )], | ||||||||||||
| 24 | 2 | }; | |||||||||||
| 25 | #---------------------------------------------------------------------# | ||||||||||||
| 26 | |||||||||||||
| 27 | |||||||||||||
| 28 | |||||||||||||
| 29 | |||||||||||||
| 30 | ### Constructor ####################################################### | ||||||||||||
| 31 | # # | ||||||||||||
| 32 | # # | ||||||||||||
| 33 | |||||||||||||
| 34 | |||||||||||||
| 35 | #---------------------------------------------------------------------# | ||||||||||||
| 36 | # CSS::SAC::Selector::Negative->new($type,$sel) | ||||||||||||
| 37 | # creates a new sac NegativeSelector object | ||||||||||||
| 38 | #---------------------------------------------------------------------# | ||||||||||||
| 39 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 40 | 0 | ▶ | my $class = ref($_[0])?ref(shift):shift; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | 0 | my $type = shift; | |||||||||||
| 42 | 0 | my $sel = shift; | |||||||||||
| 43 | |||||||||||||
| 44 | # create a selector | ||||||||||||
| 45 | 0 | my $nsel = $class->SUPER::new($type); | |||||||||||
| 46 | |||||||||||||
| 47 | # add our fields | ||||||||||||
| 48 | 0 | $nsel->[_sel_] = $sel; | |||||||||||
| 49 | |||||||||||||
| 50 | 0 | return $nsel; | |||||||||||
| 51 | } | ||||||||||||
| 52 | #---------------------------------------------------------------------# | ||||||||||||
| 53 | |||||||||||||
| 54 | |||||||||||||
| 55 | # # | ||||||||||||
| 56 | # # | ||||||||||||
| 57 | ### Constructor ####################################################### | ||||||||||||
| 58 | |||||||||||||
| 59 | |||||||||||||
| 60 | |||||||||||||
| 61 | ### Accessors ######################################################### | ||||||||||||
| 62 | # # | ||||||||||||
| 63 | # # | ||||||||||||
| 64 | |||||||||||||
| 65 | 2 | *CSS::SAC::Selector::Negative::getSimpleSelector = \&SimpleSelector; | |||||||||||
| 66 | |||||||||||||
| 67 | #---------------------------------------------------------------------# | ||||||||||||
| 68 | # my $sel = $nsel->SimpleSelector() | ||||||||||||
| 69 | # $nsel->SimpleSelector($sel) | ||||||||||||
| 70 | # get/set the selector's simple selector | ||||||||||||
| 71 | #---------------------------------------------------------------------# | ||||||||||||
| 72 | 0 | ▶ | sub SimpleSelector { | ||||||||||
|
Subroutine
SimpleSelector: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 73 | 0 | ▶ | (@_==2) ? $_[0]->[_sel_] = $_[1] : | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 74 | $_[0]->[_sel_]; | ||||||||||||
| 75 | } | ||||||||||||
| 76 | #---------------------------------------------------------------------# | ||||||||||||
| 77 | |||||||||||||
| 78 | |||||||||||||
| 79 | # # | ||||||||||||
| 80 | # # | ||||||||||||
| 81 | ### Accessors ######################################################### | ||||||||||||
| 82 | |||||||||||||
| 83 | |||||||||||||
| 84 | |||||||||||||
| 85 | 2 | 1; | |||||||||||
| 86 | |||||||||||||
| 87 | =pod | ||||||||||||
| 88 | |||||||||||||
| 89 | =head1 NAME | ||||||||||||
| 90 | |||||||||||||
| 91 | CSS::SAC::Selector::Negative - SAC NegativeSelector | ||||||||||||
| 92 | |||||||||||||
| 93 | =head1 SYNOPSIS | ||||||||||||
| 94 | |||||||||||||
| 95 | see CSS::SAC::Selector | ||||||||||||
| 96 | |||||||||||||
| 97 | =head1 DESCRIPTION | ||||||||||||
| 98 | |||||||||||||
| 99 | This is a subclass of CSS::SAC::Selector::Simple, look there for more | ||||||||||||
| 100 | documentation. This class adds the following methods (which also exist | ||||||||||||
| 101 | in spec style, simply prepend them with 'get'): | ||||||||||||
| 102 | |||||||||||||
| 103 | =head1 METHODS | ||||||||||||
| 104 | |||||||||||||
| 105 | =over 4 | ||||||||||||
| 106 | |||||||||||||
| 107 | =item * CSS::SAC::Selector::Negative->new($type,$sel) | ||||||||||||
| 108 | |||||||||||||
| 109 | =item * $nsel->new($type,$sel) | ||||||||||||
| 110 | |||||||||||||
| 111 | Creates a new negative selector. | ||||||||||||
| 112 | |||||||||||||
| 113 | =item * $nsel->SimpleSelector([$sel]) | ||||||||||||
| 114 | |||||||||||||
| 115 | get/set the selector's simple selector | ||||||||||||
| 116 | |||||||||||||
| 117 | =back | ||||||||||||
| 118 | |||||||||||||
| 119 | =head1 AUTHOR | ||||||||||||
| 120 | |||||||||||||
| 121 | Robin Berjon <robin@knowscape.com> | ||||||||||||
| 122 | |||||||||||||
| 123 | This module is licensed under the same terms as Perl itself. | ||||||||||||
| 124 | |||||||||||||
| 125 | =cut | ||||||||||||
| 126 | |||||||||||||
| 127 | |||||||||||||