| 1 | package Morris::Plugin; | ||
| 2 | use Moose; | ||
| 3 | use namespace::clean -except => qw(meta); | ||
| 4 | |||
| 5 | has connection => ( | ||
| 6 | is => 'ro', | ||
| 7 | isa => 'Morris::Connection', | ||
| 8 | writer => '_connection' | ||
| 9 | ); | ||
| 10 | |||
| 11 | sub new_from_config { | ||
| 12 | my ($class, $args) = @_; | ||
| 13 | return $class->new(%$args); | ||
| 14 | } | ||
| 15 | |||
| 16 | sub register { | ||
| 17 | my ($self, $conn) = @_; | ||
| 18 | $self->_connection( $conn ); | ||
| 19 | warn "registered $self"; | ||
| 20 | } | ||
| 21 | |||
| 22 | __PACKAGE__->meta->make_immutable(); | ||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ |