1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
# You may distribute under the terms of either the GNU General Public License
# or the Artistic License (the same terms as Perl itself)
#
# (C) Paul Evans, 2011-2024 -- leonerd@leonerd.org.uk
use v5.26;
use warnings;
use Object::Pad 0.800 ':experimental(adjust_params)';
package Tangence::Meta::Event 0.33;
class Tangence::Meta::Event :strict(params);
=head1 NAME
C<Tangence::Meta::Event> - structure representing one C<Tangence> event
=head1 DESCRIPTION
This data structure object stores information about one L<Tangence> class
event. Once constructed, such objects are immutable.
=cut
=head1 CONSTRUCTOR
=cut
=head2 new
$event = Tangence::Meta::Event->new( %args )
Returns a new instance initialised by the given arguments.
=over 8
=item class => Tangence::Meta::Class
Reference to the containing class
=item name => STRING
Name of the event
=item arguments => ARRAY
Optional ARRAY reference containing arguments as
L<Tangence::Meta::Argument> references.
=back
=cut
field $class :param :weak :reader;
field $name :param :reader;
field @arguments;
ADJUST :params (
:$arguments = undef,
) {
@arguments = $arguments->@* if $arguments;
}
=head1 ACCESSORS
=cut
=head2 class
$class = $event->class
Returns the class the event is a member of
=cut
=head2 name
$name = $event->name
Returns the name of the class
=cut
=head2 arguments
@arguments = $event->arguments
Return the arguments in a list of L<Tangence::Meta::Argument> references.
=cut
method arguments { @arguments }
=head2 argtypes
@argtypes = $event->argtypes
Return the argument types in a list of strings.
=cut
method argtypes
{
return map { $_->type } @arguments;
}
=head1 AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
=cut
0x55AA;
|