Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (14 sloc) 0.302 kb
package Catmandu::Counter;
use Catmandu::Sane;
use Moo::Role;
has count => (is => 'ro', init_arg => undef, default => sub { 0 });
sub inc_count {
++$_[0]->{count};
}
sub dec_count {
my $self = $_[0]; $self->{count} ? --$self->{count} : 0;
}
sub reset_count {
$_[0]->{count} = 0;
}
1;
Jump to Line
Something went wrong with that request. Please try again.