projects
/
gitmo/Moo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
e6ca9e7
)
correct coerce example in pod
Graham Knop [Wed, 4 Sep 2013 16:24:59 +0000 (12:24 -0400)]
lib/Moo.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Moo.pm
b/lib/Moo.pm
index
f5737fd
..
6bf3fc0
100644
(file)
--- a/
lib/Moo.pm
+++ b/
lib/Moo.pm
@@
-529,7
+529,7
@@
Takes a coderef which is meant to coerce the attribute. The basic idea is to
do something like the following:
coerce => sub {
- $_[0] + 1 unless $_[0] % 2
+ $_[0] % 2 ? $_[0] : $_[0] + 1
},
Note that L<Moo> will always fire your coercion: this is to permit