File Coverage

blib/lib/Rose/HTML/Link.pm
Criterion Covered Total %
statement 11 12 91.6
branch n/a
condition n/a
subroutine 7 8 87.5
pod 4 6 66.6
total 22 26 84.6


line stmt bran cond sub pod time code
1             package Rose::HTML::Link;
2              
3 2     2   107889 use strict;
  2         18  
  2         80  
4              
5 2     2   18 use base 'Rose::HTML::Object';
  2         4  
  2         969  
6              
7             our $VERSION = '0.606';
8              
9             __PACKAGE__->add_valid_html_attrs
10             (
11             'charset', # %Charset; #IMPLIED -- char encoding of linked resource
12             'href', # %URI; #IMPLIED -- URI for linked resource
13             'hreflang', # %LanguageCode; #IMPLIED -- language code
14             'type', # %ContentType; #IMPLIED -- advisory content type
15             'rel', # %LinkTypes; #IMPLIED -- forward link types
16             'rev', # %LinkTypes; #IMPLIED -- reverse link types
17             'media', # %MediaDesc; #IMPLIED -- for rendering on these media
18             );
19              
20 2     2 0 23 sub rel { shift->html_attr('rel', @_) }
21 2     2 0 13 sub href { shift->html_attr('href', @_) }
22              
23 0     0 1 0 sub element { 'link' }
24 1     1 1 8 sub html_element { 'link' }
25 1     1 1 9 sub xhtml_element { 'link' }
26              
27 2     2 1 10 sub is_self_closing { 1 }
28              
29             1;
30              
31             __END__
32              
33             =head1 NAME
34              
35             Rose::HTML::Link - Object representation of the "link" HTML tag.
36              
37             =head1 SYNOPSIS
38              
39             $link =
40             Rose::HTML::Link->new(
41             rel => 'stylesheet',
42             href => '/style/main.css');
43              
44             print $link->html;
45             print $link->xhtml;
46              
47             ...
48              
49             =head1 DESCRIPTION
50              
51             L<Rose::HTML::Link> is an object representation of a "link" HTML tag used to reference another document (e.g., a CSS stylesheet).
52              
53             This class inherits from, and follows the conventions of, L<Rose::HTML::Object>. Inherited methods that are not overridden will not be documented a second time here. See the L<Rose::HTML::Object> documentation for more information.
54              
55             =head1 HTML ATTRIBUTES
56              
57             Valid attributes:
58              
59             charset
60             class
61             dir
62             href
63             hreflang
64             id
65             lang
66             media
67             onclick
68             ondblclick
69             onkeydown
70             onkeypress
71             onkeyup
72             onmousedown
73             onmousemove
74             onmouseout
75             onmouseover
76             onmouseup
77             rel
78             rev
79             style
80             title
81             type
82             xml:lang
83              
84             =head1 AUTHOR
85              
86             John C. Siracusa (siracusa@gmail.com)
87              
88             =head1 LICENSE
89              
90             Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.