The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MooseX::AttributeFilter::Trait::Attribute - trait for filtered attributes

SYNOPSIS

    package My::Class;
    use Moose;
    use MooseX::AttributeFilter;
    
    has field => (
        is     => 'rw',
        filter => 'filterField',
    );
    
    sub filterField {
        my $this = shift;
        return "filtered($_[0])";
    }
    
    package main;
    My::Class->meta->get_attribute("field")->has_filter;  # true

DESCRIPTION

MooseX::AttributeFilter::Trait::Attribute is a trait for Moose::Meta::Attribute. MooseX::AttributeFilter automatically applies it to all attributes, but it acts as no-op if attribute does not use filter option.

Methods

filter

Returns the value of the filter option. This may be a string (method name) or coderef or undef.

has_filter

Boolean.

SEE ALSO

MooseX::AttributeFilter.

LICENSE

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.

AUTHOR

KITTEN <kitten@cpan.org>

https://metacpan.org/author/KITTEN

https://github.com/icklekitten

<3