This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
new perldelta
[perl5.git] / cpan / Test-Simple / lib / Test2 / EventFacet.pm
1 package Test2::EventFacet;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.302198';
6
7 use Test2::Util::HashBase qw/-details/;
8 use Carp qw/croak/;
9
10 my $SUBLEN = length(__PACKAGE__ . '::');
11 sub facet_key {
12     my $key = ref($_[0]) || $_[0];
13     substr($key, 0, $SUBLEN, '');
14     return lc($key);
15 }
16
17 sub is_list { 0 }
18
19 sub clone {
20     my $self = shift;
21     my $type = ref($self);
22     return bless {%$self, @_}, $type;
23 }
24
25 1;
26
27 __END__
28
29 =pod
30
31 =encoding UTF-8
32
33 =head1 NAME
34
35 Test2::EventFacet - Base class for all event facets.
36
37 =head1 DESCRIPTION
38
39 Base class for all event facets.
40
41 =head1 METHODS
42
43 =over 4
44
45 =item $key = $facet_class->facet_key()
46
47 This will return the key for the facet in the facet data hash.
48
49 =item $bool = $facet_class->is_list()
50
51 This will return true if the facet should be in a list instead of a single
52 item.
53
54 =item $clone = $facet->clone()
55
56 =item $clone = $facet->clone(%replace)
57
58 This will make a shallow clone of the facet. You may specify fields to override
59 as arguments.
60
61 =back
62
63 =head1 SOURCE
64
65 The source code repository for Test2 can be found at
66 F<http://github.com/Test-More/test-more/>.
67
68 =head1 MAINTAINERS
69
70 =over 4
71
72 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
73
74 =back
75
76 =head1 AUTHORS
77
78 =over 4
79
80 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
81
82 =back
83
84 =head1 COPYRIGHT
85
86 Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>.
87
88 This program is free software; you can redistribute it and/or
89 modify it under the same terms as Perl itself.
90
91 See F<http://dev.perl.org/licenses/>
92
93 =cut