Unix and Linux Discussions Tagged with counter |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
2,248 |
Shell Programming and Scripting |
|
|
|
4 |
1,838 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
11,653 |
Shell Programming and Scripting |
|
|
|
6 |
3,243 |
Shell Programming and Scripting |
|
|
|
1 |
1,900 |
Shell Programming and Scripting |
|
|
|
3 |
2,185 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,433 |
Software Releases - RSS News |
|
|
|
0 |
1,833 |
Software Releases - RSS News |
|
|
|
3 |
11,167 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
1,074 |
Software Releases - RSS News |
|
|
|
3 |
1,568 |
Shell Programming and Scripting |
|
|
|
7 |
4,528 |
Shell Programming and Scripting |
|
|
|
5 |
62,808 |
Shell Programming and Scripting |
|
|
|
0 |
2,478 |
Programming |
|
|
|
2 |
6,051 |
Shell Programming and Scripting |
|
|
|
2 |
2,474 |
Shell Programming and Scripting |
|
|
|
1 |
1,828 |
Shell Programming and Scripting |
|
|
|
3 |
4,176 |
Shell Programming and Scripting |
|
|
|
4 |
5,258 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
3,312 |
Programming |
|
|
|
5 |
3,349 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,802 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,252 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
12,933 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
5,234 |
Programming |
|
|
|
2 |
5,827 |
UNIX for Dummies Questions & Answers |
MouseX::NativeTraits::Counter(3pm) User Contributed Perl Documentation MouseX::NativeTraits::Counter(3pm)
NAME
MouseX::NativeTraits::Counter - Helper trait for counter attributes
SYNOPSIS
package MyHomePage;
use Mouse;
has 'counter' => (
traits => ['Counter'],
is => 'ro',
isa => 'Num',
default => 0,
handles => {
inc_counter => 'inc',
dec_counter => 'dec',
reset_counter => 'reset',
},
);
my $page = MyHomePage->new();
$page->inc_counter; # same as $page->counter( $page->counter + 1 );
$page->dec_counter; # same as $page->counter( $page->counter - 1 );
DESCRIPTION
This module provides a simple counter attribute, which can be incremented and decremented.
If your attribute definition does not include any of is, isa, default or handles but does use the "Counter" trait, then this module applies
defaults as in the "SYNOPSIS" above. This allows for a very basic counter definition:
has 'foo' => (traits => ['Counter']);
$obj->inc_foo;
PROVIDED METHODS
These methods are implemented in MouseX::NativeTraits::MethodProvider::Counter. It is important to note that all those methods do in place
modification of the value stored in the attribute.
set($value)
Set the counter to the specified value.
inc Increments the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount.
dec Decrements the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount.
reset
Resets the value stored in this slot to it's default value.
METHODS
meta
method_provider_class
helper_type
SEE ALSO
MouseX::NativeTraits
perl v5.14.2 2011-12-04 MouseX::NativeTraits::Counter(3pm)