X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=0d7016689f4a431c5ad0a5f748a68a444229cb34;hb=274b6ccef8d4b5faa062ca38d7207617fc1cd51f;hp=74082e43636cdf35b77c5ebcf726e89237aedefc;hpb=72b88a88c7fcec20e784aa82fc6d257e32b02a75;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 74082e4..0d70166 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -29,7 +29,7 @@ do { sub new { my $class = shift; - my %args = @_; + my %args = @_; $args{attributes} = {}; $args{superclasses} = do { @@ -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.