root/lang/perl/Class-Component/trunk/t/MyClass/Attribute/Dump.pm @ 8646

Revision 8646, 362 bytes (checked in by yappo, 5 years ago)

lang/perl/Class-Component: changed to extend attribute option like Attribute::Handlers

Line 
1package MyClass::Attribute::Dump;
2
3use strict;
4use warnings;
5use base 'Class::Component::Attribute';
6
7use YAML;
8
9sub register {
10    my($class, $plugin, $c, $method, $value, $code) = @_;
11
12    no strict 'refs';
13    no warnings 'redefine';
14    my $cname = ref($plugin) or return;
15    *{"$cname\::$method"} = sub {
16        (Dump($_[2]), Dump($value));
17    };
18}
19
201;
Note: See TracBrowser for help on using the browser.