File Coverage

blib/lib/LaTeX/TikZ/Set/Op.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 16 16 100.0


line stmt bran cond sub pod time code
1             package LaTeX::TikZ::Set::Op;
2              
3 10     10   5528 use strict;
  10         19  
  10         313  
4 10     10   6027 use warnings;
  10         19  
  10         426  
5              
6             =head1 NAME
7              
8             LaTeX::TikZ::Set::Op - A role for set objects that can be part of a path.
9              
10             =head1 VERSION
11              
12             Version 0.02
13              
14             =cut
15              
16             our $VERSION = '0.02';
17              
18             =head1 DESCRIPTION
19              
20             Ops are the components of a path.
21             They can be built together to form a path.
22             Thus, they are all the elements against which we can call the C<path> method.
23              
24             =cut
25              
26 10     10   54 use Any::Moose 'Role';
  10         19  
  10         69  
27              
28             =head1 RELATIONSHIPS
29              
30             This role consumes the L<LaTeX::TikZ::Set> role, and as such implements the L</draw> method.
31              
32             =cut
33              
34             with 'LaTeX::TikZ::Set';
35              
36             =head1 METHODS
37              
38             This method is required by the interface :
39              
40             =over 4
41              
42             =item *
43              
44             C<path $formatter>
45              
46             Returns the TikZ code that builds a path out of the current set object as a string formatted by the L<LaTeX::TikZ::Formatter> object C<$formatter>.
47              
48             =back
49              
50             =cut
51              
52             requires qw(
53             path
54             );
55              
56             =head2 C<draw>
57              
58             =cut
59              
60             sub draw {
61 186     186 1 266 my $set = shift;
62              
63 186         637 [ "\\draw " . $set->path(@_) . ' ;' ];
64             }
65              
66             =head1 SEE ALSO
67              
68             L<LaTeX::TikZ>, L<LaTeX::TikZ::Set>.
69              
70             =head1 AUTHOR
71              
72             Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
73              
74             You can contact me by mail or on C<irc.perl.org> (vincent).
75              
76             =head1 BUGS
77              
78             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>.
79             I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
80              
81             =head1 SUPPORT
82              
83             You can find documentation for this module with the perldoc command.
84              
85             perldoc LaTeX::TikZ
86              
87             =head1 COPYRIGHT & LICENSE
88              
89             Copyright 2010 Vincent Pit, all rights reserved.
90              
91             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
92              
93             =cut
94              
95             1; # End of LaTeX::TikZ::Set::Op;