diff options
author | Ricardo SIGNES <rjbs@cpan.org> | 2008-05-19 06:14:02 -0400 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-05-19 15:51:00 +0000 |
commit | bcb8f0e81fd4f3ff4e9c5cf62b09223b964ff276 (patch) | |
tree | d44075456af7be21fbbf0a72e33240925ef98e31 | |
parent | 91d0cbf6b40b82109d6a7e51347fc5d05e3eaac2 (diff) | |
download | perl-bcb8f0e81fd4f3ff4e9c5cf62b09223b964ff276.tar.gz |
correct errors / omissions in documenting DOES
Message-ID: <20080519141402.GA54401@knight.local>
p4raw-id: //depot/perl@33869
-rw-r--r-- | lib/UNIVERSAL.pm | 5 | ||||
-rw-r--r-- | pod/perlobj.pod | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm index 0d6fbe085a..6c756652fa 100644 --- a/lib/UNIVERSAL.pm +++ b/lib/UNIVERSAL.pm @@ -117,8 +117,9 @@ invocant performs the operations, merely that it does. (C<isa> of course mandates an inheritance relationship. Other relationships include aggregation, delegation, and mocking.) -By default, classes in Perl only perform the C<UNIVERSAL> role. To mark that -your own classes perform other roles, override C<DOES> appropriately. +By default, classes in Perl only perform the C<UNIVERSAL> role, as well as the +role of all classes in their inheritance. In other words, by default C<DOES> +responds identically to C<isa>. There is a relationship between roles and classes, as each class implies the existence of a role of the same name. There is also a relationship between diff --git a/pod/perlobj.pod b/pod/perlobj.pod index b6638e81b7..b0592ffc6d 100644 --- a/pod/perlobj.pod +++ b/pod/perlobj.pod @@ -407,6 +407,13 @@ X<invocant> X<blessed> C<blessed> returns the name of the package the argument has been blessed into, or C<undef>. +=item DOES(ROLE) + +C<DOES> returns I<true> if its object claims to perform the role C<ROLE>. + +By default, the response to C<DOES> is the same as the response to ISA. For +more information on C<DOES> and other universal methods, see L<UNIVERSAL>. + =item can(METHOD) X<can> |