lib/PurpleWiki/InlineNode.pm

filter: Statementstmt 90.9% 30 / 33 Branchbran 60.0% 12 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 6 totaltotal 73.1% 49 / 67 CC 11 SCAR 13.1
CC
11
Cov
79%
new
6.0
class
6.0
type
2.0
CRAP 3.7
« lib/PurpleWiki/Database/Section.pm ↑ Summary lib/PurpleWiki/Search/IrcLogger.pm »
1 # PurpleWiki::InlineNode.pm
2 #
3 # $Id: InlineNode.pm 352 2004-05-08 22:00:33Z cdent $
4 #
5 # Copyright (c) Blue Oxen Associates 2002-2003. All rights reserved.
6 #
7 # This file is part of PurpleWiki. PurpleWiki is derived from:
8 #
9 # UseModWiki v0.92 (c) Clifford A. Adams 2000-2001
10 # AtisWiki v0.3 (c) Markus Denker 1998
11 # CVWiki CVS-patches (c) Peter Merel 1997
12 # The Original WikiWikiWeb (c) Ward Cunningham
13 #
14 # PurpleWiki is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of the License, or
17 # (at your option) any later version.
18 #
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write to the
26 # Free Software Foundation, Inc.
27 # 59 Temple Place, Suite 330
28 # Boston, MA 02111-1307 USA
29  
30 package PurpleWiki::InlineNode;
31  
32 19 ▶use 5.005;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 19 our $VERSION;
36 19 $VERSION = sprintf("%d", q$Id: InlineNode.pm 352 2004-05-08 22:00:33Z cdent $ =~ /\s(\d+)\s/);
37  
38 ### constructor
39  
40 7 ▶sub new {
Subroutine new: called CC=6 SCAR=18.0
Pod undocumented
41 7 my $this = shift;
42 7 my (%options) = @_;
43 7 my $self = {};
44  
45 # TODO: Type checking.
46 7 ▶ $self->{type} = $options{type} ? $options{type} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$options{'type'} ? : 7 0 7
47 7 ▶ $self->{href} = $options{href} ? $options{href} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$options{'href'} ? : 1 6 7
48 7 ▶ $self->{class} = $options{class} ? $options{class} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$options{'class'} ? : 0 7 7
49 7 ▶ $self->{content} = $options{content} ? $options{content} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$options{'content'} ? : 6 1 7
50 7 ▶ $self->{children} = $options{children} ? $options{children} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$options{'children'} ? : 1 6 7
51 7 bless $self, $this;
52 7 return $self;
53 }
54  
55 ### accessors/mutators
56  
57 5 ▶sub type {
Subroutine type: called CC=2 SCAR=7.1
Pod undocumented
58 5 my $this = shift;
59  
60 5 ▶ $this->{type} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 5 5
61 5 return $this->{type};
62 }
63  
64 3 ▶sub href {
Subroutine href: called CC=2 SCAR=7.1
Pod undocumented
65 3 my $this = shift;
66  
67 3 ▶ $this->{href} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 3 3
68 3 return $this->{href};
69 }
70  
71 0 ▶sub class {
Subroutine class: not called CC=2 SCAR=17.9
Pod undocumented
72 0 my $this = shift;
73  
74 0 ▶ $this->{class} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
75 0 return $this->{class};
76 }
77  
78 7 ▶sub content {
Subroutine content: called CC=2 SCAR=7.1
Pod undocumented
79 7 my $this = shift;
80  
81 7 ▶ $this->{content} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 7 7
82 7 return $this->{content};
83 }
84  
85 6 ▶sub children {
Subroutine children: called CC=2 SCAR=7.1
Pod undocumented
86 6 my $this = shift;
87  
88 6 ▶ $this->{children} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 6 6
89 6 return $this->{children};
90 }
91  
92 19 1;
93 __END__
« lib/PurpleWiki/Database/Section.pm ↑ Summary lib/PurpleWiki/Search/IrcLogger.pm »