Class::Operator(PoC)
Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/Class
t
xt
.gitignore
.shipit
Changes
MANIFEST
MANIFEST.SKIP
Makefile.PL
README.mkdn

README.mkdn

NAME

Class::Operator -

SYNOPSIS

package Counter2;
use Class::Operator;

sub import {
    my ($class, $opts) = @_;

    my $name = $opts->{name} // die;

    with caller(0) => sub {
        mk_accessors $name;
        method "increment_${name}" => sub {
            $_[0]->$name( $_[0]->$name + 1 );
        };
        method "reset_${name}" => sub {
            $_[0]->$name( 0 );
        };
    };
}

DESCRIPTION

Class::Operator is

AUTHOR

Tokuhiro Matsuno

SEE ALSO

LICENSE

Copyright (C) Tokuhiro Matsuno

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