X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=42f824e57f91d018a6b7908efc210905820f756b;hb=a2227e71332a3c0e26445c14c7bb596eb06dbc92;hp=74082e43636cdf35b77c5ebcf726e89237aedefc;hpb=72b88a88c7fcec20e784aa82fc6d257e32b02a75;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 74082e4..42f824e 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -78,6 +78,7 @@ sub compute_all_applicable_attributes { } sub get_attribute_map { $_[0]->{attributes} } +sub has_attribute { exists $_[0]->{attributes}->{$_[1]} } sub get_attribute { $_[0]->{attributes}->{$_[1]} } sub linearized_isa { @{ mro::get_linear_isa($_[0]->name) } } @@ -124,6 +125,10 @@ this class and its superclasses. Returns a mapping of attribute names to their corresponding L objects. +=head2 has_attribute Name -> Boool + +Returns whether we have a L with the given name. + =head2 get_attribute Name -> Mouse::Meta::Attribute | undef Returns the L with the given name.