Skip to content
Browse files

use Mouse excellent delegation API

  • Loading branch information...
1 parent b4eeac1 commit ae8c8e54bfbae311c3e4cf441a761c27c1fac030 forwardever committed Nov 9, 2011
Showing with 6 additions and 14 deletions.
  1. +6 −14 lib/Forward/ORM/Migrations/Migration.pm
View
20 lib/Forward/ORM/Migrations/Migration.pm
@@ -22,6 +22,12 @@ has file_name => (is => 'ro', required => 1);
has path => (is => 'ro', required => 1);
+# delegate to Migrations::Manager
+has manager => (
+ default => sub {Forward::ORM::Migrations::Manager->new},
+ handles => [qw/add_column create_table remove_column/]
+);
+
## ---------------------------------------------------------------------------
## Methods
@@ -89,18 +95,4 @@ method compile {
}
-
-## ---------------------------------------------------------------------------
-## Delegation
-## ---------------------------------------------------------------------------
-
-method manager {Forward::ORM::Migrations::Manager->new}
-
-method create_table (@params) {$self->manager->create_table(@params)}
-
-method add_column (@params) {$self->manager->add_column(@params)}
-
-method remove_column (@params) {$self->manager->remove_column(@params)}
-
-
1;

0 comments on commit ae8c8e5

Please sign in to comment.
Something went wrong with that request. Please try again.