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