SAC/Condition/Negative.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 89.1% 33 / 37 CC 3 SCAR 4.3
CC
3
Cov
89%
Condition
2.1
new
2.0
BEGIN
1.0
CRAP 1.5
« SAC/Selector/Descendant.pm ↑ Summary SAC/Selector/Simple.pm »
1
2 ###
3 # CSS::SAC::Condition::Negative - SAC NegativeConditions
4 # Robin Berjon <robin@knowscape.com>
5 # 24/02/2001
6 ###
7
8 package CSS::SAC::Condition::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'
l!l
02
MC/DC0%0/1
$CSS::SAC::VERSION || '0.03'
$CSS::SAC::VERSION
Truth table50%1/2
A
A= $CSS::SAC::VERSION
Aresult
11
00
12
13 2 ▶use base qw(CSS::SAC::Condition);
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::Condition',
21 with => [qw(
22 _cond_
23 )],
24 2 };
25 #---------------------------------------------------------------------#
26
27
28
29
30 ### Constructor #######################################################
31 # #
32 # #
33
34
35 #---------------------------------------------------------------------#
36 # CSS::SAC::Condition::Negative->new($type,$cond)
37 # creates a new sac NegativeCondition object
38 #---------------------------------------------------------------------#
39 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
40 2 ▶ my $class = ref($_[0])?ref(shift):shift;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 2 2
41 2 my $type = shift; # should be one of the content conditions
42 2 my $cond = shift;
43
44 # create a condition
45 2 my $ncond = $class->SUPER::new($type);
46
47 # add our fields
48 2 $ncond->[_cond_] = $cond;
49
50 2 return $ncond;
51 }
52 #---------------------------------------------------------------------#
53
54
55 # #
56 # #
57 ### Constructor #######################################################
58
59
60
61 ### Accessors #########################################################
62 # #
63 # #
64
65 # aliases
66 2 *CSS::SAC::Condition::Negative::getCondition = \&Condition;
67
68
69 #---------------------------------------------------------------------#
70 # my $cond = $ncond->Condition()
71 # $ncond->Condition($cond)
72 # get/set the condition's sub condition
73 #---------------------------------------------------------------------#
74 2 ▶sub Condition {
Subroutine Condition: called CC=2 SCAR=7.6
Pod documented
75 2 ▶ (@_==2) ? $_[0]->[_cond_] = $_[1] :
Branch: 1 branch
BranchTrueFalseTotal
@_ == 2 ? : 0 2 2
76 $_[0]->[_cond_];
77 }
78 #---------------------------------------------------------------------#
79
80
81 # #
82 # #
83 ### Accessors #########################################################
84
85
86
87 2 1;
88
89 =pod
90
91 =head1 NAME
92
93 CSS::SAC::Condition::Negative - SAC NegativeConditions
94
95 =head1 SYNOPSIS
96
97 see CSS::SAC::Condition
98
99 =head1 DESCRIPTION
100
101 This is a subclass of CSS::SAC::Condition, look there for more
102 documentation. This class adds the following methods (the spec
103 equivalents are available as well, just prepend 'get'):
104
105 =head1 METHODS
106
107 =over 4
108
109 =item * CSS::SAC::Condition::Negative->new($type,$cond)
110
111 =item * $cond->new($type,$cond)
112
113 Creates a new negative condition.
114
115 =item * $ccond->Condition([$cond])
116
117 get/set the condition's sub condition
118
119 =back
120
121 =head1 AUTHOR
122
123 Robin Berjon <robin@knowscape.com>
124
125 This module is licensed under the same terms as Perl itself.
126
127 =cut
128
129
« SAC/Selector/Descendant.pm ↑ Summary SAC/Selector/Simple.pm »