XRandR/Dimension.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 1 / 1 totaltotal 93.5% 29 / 31 CC 1 SCAR 1.3
CC
1
Cov
96%
to_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« XRandR/Offset.pm ↑ Summary XRandR/Mode.pm »
1 package X11::XRandR::Dimension;
2  
3 # ABSTRACT: Dimension of Screen or Display
4  
5 2 ▶use Types::Standard qw[ Enum ];
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Types::Common::Numeric qw[ PositiveOrZeroInt ];
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use MooX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 our $VERSION = '0.01';
13  
14 #pod =attr x
15 #pod
16 #pod =attr y
17 #pod
18 #pod A dimension.
19 #pod
20 #pod =cut
21  
22 2 ▶use overload '""' => \&to_string;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 has $_ => (
24 is => 'ro',
25 isa => PositiveOrZeroInt,
26 required => 1,
27 2 ) for qw[ x y ];
28  
29 #pod =attr unit
30 #pod
31 #pod Units; either C<pixel> or C<mm>
32 #pod
33 #pod =cut
34  
35 2 has unit => (
36 is => 'ro',
37 isa => Enum[ qw[ pixel mm ] ],
38 default => 'pixel',
39 );
40  
41 #pod =method to_string
42 #pod
43 #pod Return a string rendition of the object just as B<xrandr> would.
44 #pod
45 #pod =cut
46  
47 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
Pod documented
48 0 sprintf( "%dx%d", $_[0]->x, $_[0]->y );
49 }
50  
51 2 1;
52  
53 #
54 # This file is part of X11-XRandR
55 #
56 # This software is Copyright (c) 2018 by Diab Jerius.
57 #
58 # This is free software, licensed under:
59 #
60 # The GNU General Public License, Version 3, June 2007
61 #
62  
63 __END__
« XRandR/Offset.pm ↑ Summary XRandR/Mode.pm »