| 1 | # | ||
| 2 | # This file is part of MooseX-CurriedDelegation | ||
| 3 | # | ||
| 4 | # This software is Copyright (c) 2012 by Chris Weyl. | ||
| 5 | # | ||
| 6 | # This is free software, licensed under: | ||
| 7 | # | ||
| 8 | # The GNU Lesser General Public License, Version 2.1, February 1999 | ||
| 9 | # | ||
| 10 | package MooseX::CurriedDelegation; | ||
| 11 | 2 | our $AUTHORITY = 'cpan:RSRCHBOY'; | |
| 12 | # git description: 0.002-9-g914914b | ||
| 13 | 2 | $MooseX::CurriedDelegation::VERSION = '0.003'; | |
| 14 | |||
| 15 | # ABSTRACT: Curry your delegations with methods | ||
| 16 | |||
| 17 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | |||
| 20 | 2 | ▶ | use Moose ( ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 2 | ▶ | use Moose::Exporter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 2 | my $trait = 'MooseX::CurriedDelegation::Trait::Attribute'; | |
| 24 | |||
| 25 | 2 | Moose::Exporter->setup_import_methods( | |
| 26 | trait_aliases => [ [ $trait => 'CurriedDelegation' ] ], | ||
| 27 | |||
| 28 | as_is => [ qw{ curry_to_self } ], | ||
| 29 | class_metaroles => { attribute => [ $trait ] }, | ||
| 30 | role_metaroles => { applied_attribute => [ $trait ] }, | ||
| 31 | ); | ||
| 32 | |||
| 33 | 2 | ▶ | sub curry_to_self() { sub { shift } } |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
curry_to_self: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | |||
| 35 | 2 | !!42; | |
| 36 | |||
| 37 | __END__ | ||