[libclass-tiny-perl] 20/22: doc tweaks
gregor herrmann
gregoa at debian.org
Sun May 31 14:03:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to annotated tag release-0.001
in repository libclass-tiny-perl.
commit 6e1b9159c2a74d65899ec28d6dbc09a3f737c74f
Author: David Golden <dagolden at cpan.org>
Date: Fri Aug 16 09:49:25 2013 -0400
doc tweaks
---
README.pod | 21 +++++++++++++--------
lib/Class/Tiny.pm | 21 +++++++++++++--------
2 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/README.pod b/README.pod
index 1944104..62b93e0 100644
--- a/README.pod
+++ b/README.pod
@@ -146,9 +146,9 @@ of allowed constructor parameters.
=head2 Class::Tiny is your base class
-If your class does not already inherit from some class, then Class::Tiny will
-be added to your C<@ISA> to provide C<new> and C<DESTROY>. (The superclass
-C<import> method will silently do nothing for subclasses.)
+If your class B<does not> already inherit from some class, then Class::Tiny
+will be added to your C<@ISA> to provide C<new> and C<DESTROY>. (The
+superclass C<import> method will silently do nothing for subclasses.)
If your class B<does> inherit from something, then no additional inheritance is
set up. If the parent subclasses Class::Tiny, then all is well. If not, then
@@ -184,8 +184,8 @@ the reference provided.
=head2 BUILD
If your class or any superclass defines a C<BUILD> method, they will be called
-by the constructor from furthest parent class down to the child class after the
-object has been created. No arguments are provided and the return value is
+by the constructor from the furthest parent class down to the child class after
+the object has been created. No arguments are provided and the return value is
ignored. Use them for validation or setting default values.
sub BUILD {
@@ -197,9 +197,14 @@ ignored. Use them for validation or setting default values.
=head2 DEMOLISH
Class::Tiny provides a C<DESTROY> method. If your class or any superclass
-defines a C<DEMOLISH> method, they will be called from the
-child class to the furthest parent class during object destruction. No
-arguments are provided. Return values and errors are ignored.
+defines a C<DEMOLISH> method, they will be called from the child class to the
+furthest parent class during object destruction. No arguments are provided.
+Return values and errors are ignored.
+
+ sub DEMOLISH {
+ my $self = shift;
+ $self->cleanup();
+ }
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
diff --git a/lib/Class/Tiny.pm b/lib/Class/Tiny.pm
index fa4249f..c4e63b3 100644
--- a/lib/Class/Tiny.pm
+++ b/lib/Class/Tiny.pm
@@ -209,9 +209,9 @@ of allowed constructor parameters.
=head2 Class::Tiny is your base class
-If your class does not already inherit from some class, then Class::Tiny will
-be added to your C<@ISA> to provide C<new> and C<DESTROY>. (The superclass
-C<import> method will silently do nothing for subclasses.)
+If your class B<does not> already inherit from some class, then Class::Tiny
+will be added to your C<@ISA> to provide C<new> and C<DESTROY>. (The
+superclass C<import> method will silently do nothing for subclasses.)
If your class B<does> inherit from something, then no additional inheritance is
set up. If the parent subclasses Class::Tiny, then all is well. If not, then
@@ -247,8 +247,8 @@ the reference provided.
=head2 BUILD
If your class or any superclass defines a C<BUILD> method, they will be called
-by the constructor from furthest parent class down to the child class after the
-object has been created. No arguments are provided and the return value is
+by the constructor from the furthest parent class down to the child class after
+the object has been created. No arguments are provided and the return value is
ignored. Use them for validation or setting default values.
sub BUILD {
@@ -260,9 +260,14 @@ ignored. Use them for validation or setting default values.
=head2 DEMOLISH
Class::Tiny provides a C<DESTROY> method. If your class or any superclass
-defines a C<DEMOLISH> method, they will be called from the
-child class to the furthest parent class during object destruction. No
-arguments are provided. Return values and errors are ignored.
+defines a C<DEMOLISH> method, they will be called from the child class to the
+furthest parent class during object destruction. No arguments are provided.
+Return values and errors are ignored.
+
+ sub DEMOLISH {
+ my $self = shift;
+ $self->cleanup();
+ }
=cut
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libclass-tiny-perl.git
More information about the Pkg-perl-cvs-commits
mailing list