| 1 | package Term::Caca::Event; | ||||||||||
| 2 | 8 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||
| 3 | # ABSTRACT: base class for Term::Caca events | ||||||||||
| 4 | 8 | $Term::Caca::Event::VERSION = '3.0.0'; | |||||||||
| 5 | |||||||||||
| 6 | 8 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 8 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 8 | ▶ | use FFI::Platypus::Memory; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 8 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 8 | has event => ( | |||||||||
| 14 | is => 'ro', | ||||||||||
| 15 | required => 1, | ||||||||||
| 16 | predicate => 'has_event', | ||||||||||
| 17 | ); | ||||||||||
| 18 | |||||||||||
| 19 | has type => ( | ||||||||||
| 20 | is => 'ro', | ||||||||||
| 21 | lazy => 1, | ||||||||||
| 22 | default => sub { | ||||||||||
| 23 | 0 | ▶ | ( ref $_[0] ) =~ s/Term::Caca::Event:://r; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 24 | } | ||||||||||
| 25 | 8 | ); | |||||||||
| 26 | |||||||||||
| 27 | sub DEMOLISH { | ||||||||||
| 28 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
DEMOLISH: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | free $self->event if $self->has_event; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 8 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||
| 36 | |||||||||||
| 37 | =pod | ||||||||||
| 38 | |||||||||||
| 39 | =encoding UTF-8 | ||||||||||
| 40 | |||||||||||
| 41 | =head1 NAME | ||||||||||
| 42 | |||||||||||
| 43 | Term::Caca::Event - base class for Term::Caca events | ||||||||||
| 44 | |||||||||||
| 45 | =head1 VERSION | ||||||||||
| 46 | |||||||||||
| 47 | version 3.0.0 | ||||||||||
| 48 | |||||||||||
| 49 | =head1 DESCRIPTION | ||||||||||
| 50 | |||||||||||
| 51 | This class is inherited by the C<Term::Caca::Event::*> | ||||||||||
| 52 | classes, and shouldn't be used directly. | ||||||||||
| 53 | |||||||||||
| 54 | =head1 ATTRIBUTES | ||||||||||
| 55 | |||||||||||
| 56 | =head2 event | ||||||||||
| 57 | |||||||||||
| 58 | Required. The underlying caca event structure. | ||||||||||
| 59 | |||||||||||
| 60 | =head2 type | ||||||||||
| 61 | |||||||||||
| 62 | Holds the name of the event (which is the | ||||||||||
| 63 | name of the class without the | ||||||||||
| 64 | leading C<Term::Caca::Event::>. | ||||||||||
| 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 | ||||||||||