Clicker/Positioned.pm

filter: Statementstmt 61.9% 13 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 100% 4 / 4 totaltotal 62.5% 20 / 32 CC 1 SCAR 4.5
CC
1
Cov
62%
is_left
2.0
is_right
2.0
is_top
2.0
CRAP 1.6
« Clicker/Renderer/StackedBar.pm ↑ Summary Clicker/Renderer/Bubble.pm »
1 package Chart::Clicker::Positioned;
2 11 $Chart::Clicker::Positioned::VERSION = '2.89';
3 11 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # ABSTRACT: Role for components that care about position.
6  
7 11 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 11 enum 'Chart::Clicker::Position' => [qw(left right top bottom)];
10  
11  
12 11 has 'position' => (
13 is => 'rw',
14 isa => 'Chart::Clicker::Position'
15 );
16  
17  
18 sub is_left {
19 0 ▶ my ($self) = @_;
Subroutine is_left: not called CC=1 SCAR=6.9
Pod documented
20  
21 0 return $self->position eq 'left';
22 }
23  
24  
25 sub is_right {
26 0 ▶ my ($self) = @_;
Subroutine is_right: not called CC=1 SCAR=6.9
Pod documented
27  
28 0 return $self->position eq 'right';
29 }
30  
31  
32 sub is_top {
33 0 ▶ my ($self) = @_;
Subroutine is_top: not called CC=1 SCAR=6.9
Pod documented
34  
35 0 return $self->position eq 'top';
36 }
37  
38  
39 sub is_bottom {
40 0 ▶ my ($self) = @_;
Subroutine is_bottom: not called CC=1 SCAR=6.9
Pod documented
41  
42 0 return $self->position eq 'bottom';
43 }
44  
45 11 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 11 1;
47  
48 __END__
49  
50 =pod
51  
52 =head1 NAME
53  
54 Chart::Clicker::Positioned - Role for components that care about position.
55  
56 =head1 VERSION
57  
58 version 2.89
59  
60 =head1 SYNOPSIS
61  
62 package My::Component;
63 use Moose;
64  
65 extends 'Chart::Clicker::Drawing::Component';
66  
67 with 'Chart::Clicker::Positioned';
68  
69 1;
70  
71 =head1 DESCRIPTION
72  
73 Some components draw differently depending on which 'side' they are
74 positioned. If an Axis is on the left, it will put the numbers left and the
75 bar on the right. If positioned on the other side then those two piece are
76 reversed.
77  
78 =head1 ATTRIBUTES
79  
80 =head2 position
81  
82 The 'side' on which this component is positioned.
83  
84 =head1 METHODS
85  
86 =head2 is_left
87  
88 Returns true if the component is positioned left.
89  
90 =head2 is_right
91  
92 Returns true if the component is positioned right.
93  
94 =head2 is_top
95  
96 Returns true if the component is positioned top.
97  
98 =head2 is_bottom
99  
100 Returns true if the component is positioned bottom.
101  
102 =head1 AUTHOR
103  
104 Cory G Watson <gphat@cpan.org>
105  
106 =head1 COPYRIGHT AND LICENSE
107  
108 This software is copyright (c) 2016 by Cory G Watson.
109  
110 This is free software; you can redistribute it and/or modify it under
111 the same terms as the Perl 5 programming language system itself.
112  
113 =cut
« Clicker/Renderer/StackedBar.pm ↑ Summary Clicker/Renderer/Bubble.pm »