File Coverage

blib/lib/LaTeX/TikZ/Mod/Raw.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod 4 5 80.0
total 32 33 96.9


line stmt bran cond sub pod time code
1             package LaTeX::TikZ::Mod::Raw;
2              
3 10     10   58 use strict;
  10         22  
  10         343  
4 10     10   56 use warnings;
  10         27  
  10         402  
5              
6             =head1 NAME
7              
8             LaTeX::TikZ::Mod::Raw - A literal TikZ modifier.
9              
10             =head1 VERSION
11              
12             Version 0.02
13              
14             =cut
15              
16             our $VERSION = '0.02';
17              
18 10     10   67 use LaTeX::TikZ::Interface;
  10         20  
  10         329  
19              
20 10     10   57 use Any::Moose;
  10         19  
  10         84  
21              
22             =head1 RELATIONSHIPS
23              
24             This class consumes the L<LaTeX::TikZ::Mod> role, and as such implements the L</tag>, L</covers>, L</declare> and L</apply> methods.
25              
26             =cut
27              
28             with 'LaTeX::TikZ::Mod';
29              
30             =head1 ATTRIBUTES
31              
32             =head2 C<content>
33              
34             =cut
35              
36             has 'content' => (
37             is => 'ro',
38             isa => 'Str',
39             required => 1,
40             );
41              
42             =head1 METHODS
43              
44             =head2 C<tag>
45              
46             =cut
47              
48             sub tag {
49 26     26 1 45 my ($self) = @_;
50              
51 26         121 ref($self) . '/' . $self->content;
52             }
53              
54             =head2 C<covers>
55              
56             =cut
57              
58 2     2 1 12 sub covers { 0 }
59              
60             =head2 C<declare>
61              
62             =cut
63              
64 11     11 1 40 sub declare { }
65              
66             =head2 C<apply>
67              
68             =cut
69              
70 13     13 1 78 sub apply { $_[0]->content }
71              
72             LaTeX::TikZ::Interface->register(
73             raw_mod => sub {
74 4     4 0 2608 shift;
75              
76 4         53 __PACKAGE__->new(content => $_[0]);
77             },
78             );
79              
80             __PACKAGE__->meta->make_immutable;
81              
82             =head1 SEE ALSO
83              
84             L<LaTeX::TikZ>, L<LaTeX::TikZ::Mod>.
85              
86             =head1 AUTHOR
87              
88             Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
89              
90             You can contact me by mail or on C<irc.perl.org> (vincent).
91              
92             =head1 BUGS
93              
94             Please report any bugs or feature requests to C<bug-latex-tikz at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LaTeX-TikZ>.
95             I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
96              
97             =head1 SUPPORT
98              
99             You can find documentation for this module with the perldoc command.
100              
101             perldoc LaTeX::TikZ
102              
103             =head1 COPYRIGHT & LICENSE
104              
105             Copyright 2010 Vincent Pit, all rights reserved.
106              
107             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
108              
109             =cut
110              
111             1; # End of LaTeX::TikZ::Mod::Raw