projects
/
gitmo/MooseX-AttributeHelpers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
8ba40fb
)
tweaking
Stevan Little [Mon, 7 May 2007 16:37:03 +0000 (16:37 +0000)]
lib/MooseX/AttributeHelpers/Base.pm
patch
|
blob
|
blame
|
history
lib/MooseX/AttributeHelpers/Counter.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/MooseX/AttributeHelpers/Base.pm
b/lib/MooseX/AttributeHelpers/Base.pm
index
267ffbe
..
3d13d16
100644
(file)
--- a/
lib/MooseX/AttributeHelpers/Base.pm
+++ b/
lib/MooseX/AttributeHelpers/Base.pm
@@
-31,6
+31,7
@@
sub helper_type { () }
sub process_options_for_provides {
my ($self, $options) = @_;
+
if (my $type = $self->helper_type) {
(exists $options->{isa})
|| confess "You must define a type with the $type metaclass";
diff --git
a/lib/MooseX/AttributeHelpers/Counter.pm
b/lib/MooseX/AttributeHelpers/Counter.pm
index
86c1317
..
0e8fb70
100644
(file)
--- a/
lib/MooseX/AttributeHelpers/Counter.pm
+++ b/
lib/MooseX/AttributeHelpers/Counter.pm
@@
-54,11
+54,13
@@
MooseX::AttributeHelpers::Counter
default => sub { 0 },
provides => {
inc => 'inc_counter',
+ dec => 'dec_counter',
}
);
my $page = MyHomePage->new();
$page->inc_counter; # same as $page->counter($page->counter + 1);
+ $page->dec_counter; # same as $page->counter($page->counter - 1);
=head1 DESCRIPTION