File Coverage

blib/lib/LaTeX/TikZ/Mod/Width.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 4 5 80.0
total 35 36 97.2


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