MooseX::AttributeFilter::Trait::Attribute::Role - trait for filtered attributes in roles
package My::Role; use Moose::Role; use MooseX::AttributeFilter; has field => ( is => 'rw', filter => 'filterField', ); sub filterField { my $this = shift; return "filtered($_[0])"; } package My::Class; use Moose; with 'My::Role'; package main; My::Role->meta->get_attribute("field")->has_filter; # true
This basically does nothing but is used when a role containing filtered attributes is composed into a class.
It has some things for introspection tho. c:
filter
Returns the value of the filter option. This may be a string (method name) or coderef or undef.
has_filter
Boolean.
MooseX::AttributeFilter.
Copyright (C) 2018 Little Princess Kitten <kitten@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
KITTEN <kitten@cpan.org>
https://metacpan.org/author/KITTEN
https://github.com/icklekitten
<3
To install MooseX::AttributeFilter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::AttributeFilter
CPAN shell
perl -MCPAN -e shell install MooseX::AttributeFilter
For more information on module installation, please visit the detailed CPAN module installation guide.