| 1 | package Class::Component::Attribute::Hook; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | use base 'Class::Component::Attribute'; | ||
| 6 | |||
| 7 | sub register { | ||
| 8 | my($class, $plugin, $c, $method, $value) = @_; | ||
| 9 | |||
| 10 | $value ||= $method; | ||
| 11 | $c->register_hook( $value => { plugin => $plugin, method => $method } ); | ||
| 12 | } | ||
| 13 | |||
| 14 | 1; |