NAKAGAWA Masaki > MouseX-AttributeHelpers-0.07 > MouseX::AttributeHelpers::Counter

Download:
MouseX-AttributeHelpers-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

MouseX::AttributeHelpers::Counter

SYNOPSIS ^

    package MyHomePage;
    use Mouse;
    use MouseX::AttributeHelpers;

    has 'counter' => (
        metaclass => 'Counter',
        is        => 'rw',
        isa       => 'Num',
        default   => 0,
        provides  => {
            inc   => 'inc_counter',
            dec   => 'dec_counter',
            reset => 'reset_counter',
        },
    );

    package main;
    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.

PROVIDERS ^

reset

set

inc

dec

METHODS ^

method_constructors

helper_type

helper_default

AUTHOR ^

NAKAGAWA Masaki <masaki@cpan.org>

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

MouseX::AttributeHelpers, MouseX::AttributeHelpers::Base

syntax highlighting: