File: Plugin.pm

package info (click to toggle)
libspoon-perl 0.24-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 296 kB
  • sloc: perl: 2,640; makefile: 2
file content (48 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package Spoon::Plugin;
use Spoon::Base -Base;

sub class_title_prefix { () }

sub class_id {
    my $package = ref $self;
    $package =~ s/.*:://;
    lc($package);
}

sub class_title {
    join ' ', map {
        s/(.*)/\u$1/;
        $_;
    } $self->class_title_prefix, split '_', $self->class_id;
}

sub register {
    $self->hub->registry->add(action => $self->class_id, 'process')
      if $self->can('process');
    return $self;
}

__END__

=head1 NAME 

Spoon::Plugin - Spoon Plugin Base Class

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 AUTHOR

Brian Ingerson <INGY@cpan.org>

=head1 COPYRIGHT

Copyright (c) 2004. Brian Ingerson. All rights reserved.

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

See http://www.perl.com/perl/misc/Artistic.html

=cut