File Coverage

blib/lib/Netscape/Bookmarks/Separator.pm
Criterion Covered Total %
statement 20 22 90.9
branch 2 2 100.0
condition n/a
subroutine 6 8 75.0
pod 4 4 100.0
total 32 36 88.8


line stmt bran cond sub pod time code
1             package Netscape::Bookmarks::Separator;
2              
3             =encoding utf8
4              
5             =head1 NAME
6              
7             Netscape::Bookmarks::Separator - manipulate, or create Netscape Bookmarks files
8              
9             =head1 SYNOPSIS
10              
11             use Netscape::Bookmarks::Category;
12             use Netscape::Bookmarks::Separator;
13              
14             #add a separator to a category listing
15             my $category = new Netscape::Bookmarks::Category { ... };
16             my $separator = new Netscape::Bookmarks::Separator;
17             my $category->add($separator);
18              
19             #print the separator
20             #note that Netscape::Category::as_string does this for you
21             print $separator->as_string;
22              
23             =head1 DESCRIPTION
24              
25             Store a Netscape bookmark separator object.
26              
27             =head1 METHODS
28              
29             =over 4
30              
31             =cut
32              
33 6     6   21357 use strict;
  6         13  
  6         190  
34              
35 6     6   31 use base qw( Netscape::Bookmarks::AcceptVisitor Netscape::Bookmarks::Isa );
  6         13  
  6         1113  
36 6     6   32 use subs qw();
  6         12  
  6         130  
37 6     6   27 use vars qw( $VERSION );
  6         12  
  6         1027  
38              
39             $VERSION = "2.301";
40              
41             my $singleton = undef;
42              
43             =item Netscape::Bookmarks::Separator->new
44              
45             Creates a new Separator object. This method takes no arguments.
46             This object represents a Singleton object. The module only
47             makes on instance which everybody else shares.
48              
49             =cut
50              
51             sub new {
52 6 100   6 1 799 return $singleton if defined $singleton;
53              
54 3         9 my $class = shift;
55              
56 3         6 my $n = '';
57 3         14 my $self = \$n;
58              
59 3         7 bless $self, $class;
60              
61 3         6 $singleton = $self;
62              
63 3         9 $singleton;
64             }
65              
66             =item $obj->as_string
67              
68             Prints the separator object in the Netscape bookmark format. One should
69             not have to do this as Netscape::Bookmarks::Category will take care of it.
70              
71             =cut
72              
73 2     2 1 6 sub as_string { "
" }
74              
75             =item $obj->title
76              
77             Prints a string to represent a separator. This method exists to
78             round out polymorphism among the Netscape::* classes. The
79             string does not have a trailing newline.
80              
81             =cut
82              
83 0     0 1   sub title { "-" x 50 }
84              
85             =item $obj->remove
86              
87             Performs any clean up necessary to remove this object from the
88             Bookmarks tree.
89              
90             =cut
91              
92 0     0 1   sub remove { 1; }
93              
94             "if you want to believe everything you read, so be it.";
95              
96             =back
97              
98             =head1 AUTHOR
99              
100             brian d foy C<< >>
101              
102             =head1 COPYRIGHT AND LICENSE
103              
104             Copyright © 2002-2016, brian d foy . All rights reserved.
105             This program is free software; you can redistribute it and/or modify
106             it under the same terms as Perl itself.
107              
108             =head1 SEE ALSO
109              
110             L
111              
112             =cut