Begin adding a Mouse::Meta::Role which is accessible through Role->meta
[gitmo/Mouse.git] / lib / Mouse / Meta / Class.pm
index 74082e4..42f824e 100644 (file)
@@ -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<Mouse::Meta::Attribute> objects.
 
+=head2 has_attribute Name -> Boool
+
+Returns whether we have a L<Mouse::Meta::Attribute> with the given name.
+
 =head2 get_attribute Name -> Mouse::Meta::Attribute | undef
 
 Returns the L<Mouse::Meta::Attribute> with the given name.