Search code examples
perlmoosetraits

Find all Attributes with given Trait


I've looked and looked but can't seem to find a Moose::Meta function to return all Attributes that have a given trait.

Is this possible?


Solution

  • Seems I didn't search deep enough:

    Moose::Meta::Role

    $metarole->consumers; Returns a list of names of classes and roles which consume this role.