Caca/Event/Resize.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Caca/Event/Mouse/Motion.pm ↑ Summary Caca/Sprite.pm »
1 package Term::Caca::Event::Resize;
2 our $AUTHORITY = 'cpan:YANICK';
3 # ABSTRACT: event triggered when the display is resized
4 $Term::Caca::Event::Resize::VERSION = '3.0.0';
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Term::Caca;
Subroutine BEGIN: called CC=1 SCAR=2.6
9  
10  
11 use Moose;
12 extends 'Term::Caca::Event';
13  
14 has width =>
15 is => 'ro',
16 lazy => 1,
17 default => sub {
18 Term::Caca::caca_get_event_resize_width( $_[0]->event );
19 };
20  
21 has height =>
22 is => 'ro',
23 lazy => 1,
24 default => sub {
25 Term::Caca::caca_get_event_resize_height( $_[0]->event );
26 };
27  
28  
29 has size =>
30 is => 'ro',
31 lazy => 1,
32 default => sub {
33 [ $_[0]->width, $_[0]->height ];
34 };
35  
36 1;
37  
38 __END__
39  
40 =pod
41  
42 =encoding UTF-8
43  
44 =head1 NAME
45  
46 Term::Caca::Event::Resize - event triggered when the display is resized
47  
48 =head1 VERSION
49  
50 version 3.0.0
51  
52 =head1 ATTRIBUTES
53  
54 =head2 width
55  
56 New width of the display.
57  
58 =head2 height
59  
60 New height of the display.
61  
62 =head2 size
63  
64 New size of the display, as an array ref of the width and height.
65  
66 =head1 AUTHORS
67  
68 =over 4
69  
70 =item *
71  
72 John Beppu <beppu@cpan.org>
73  
74 =item *
75  
76 Yanick Champoux <yanick@cpan.org>
77  
78 =back
79  
80 =head1 COPYRIGHT AND LICENSE
81  
82 This software is Copyright (c) 2018, 2013, 2011 by John Beppu.
83  
84 This is free software, licensed under:
85  
86 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE, Version 2, December 2004
87  
88 =cut
« Caca/Event/Mouse/Motion.pm ↑ Summary Caca/Sprite.pm »