| 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
| |||||||||||
| 47 | 7 | ▶ | $self->{href} = $options{href} ? $options{href} : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 7 | ▶ | $self->{class} = $options{class} ? $options{class} : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 7 | ▶ | $self->{content} = $options{content} ? $options{content} : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 7 | ▶ | $self->{children} = $options{children} ? $options{children} : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 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
| |||||||||||
| 89 | 6 | return $this->{children}; | |||||||||
| 90 | } | ||||||||||
| 91 | |||||||||||
| 92 | 19 | 1; | |||||||||
| 93 | __END__ | ||||||||||