diff options
-rw-r--r-- | lib/Narwhal/Component/Role/Wiki.pm | 31 | ||||
-rw-r--r-- | lib/Narwhal/Component/Wiki/Edit.pm | 24 | ||||
-rw-r--r-- | lib/Narwhal/Component/Wiki/Page.pm | 24 |
3 files changed, 33 insertions, 46 deletions
diff --git a/lib/Narwhal/Component/Role/Wiki.pm b/lib/Narwhal/Component/Role/Wiki.pm new file mode 100644 index 0000000..c57cf7e --- /dev/null +++ b/lib/Narwhal/Component/Role/Wiki.pm @@ -0,0 +1,31 @@ +package Narwhal::Component::Role::Wiki; +use Moose::Role; + +has kioku => ( + isa => 'KiokuX::Model', + required => 1, + handles => 'KiokuDB::Role::API', +); + +has tt => ( + isa => 'Template', + required => 1, + handles => ['process'], +); + +has scope => ( + is => 'ro', + isa => 'KiokuDB::LiveObjects::Scope', + lazy => 1, + default => sub { shift->new_scope }, +); + +sub BUILD { } +after BUILD => sub { + my $self = shift; + $self->scope; +}; + +no Moose::Role; + +1; diff --git a/lib/Narwhal/Component/Wiki/Edit.pm b/lib/Narwhal/Component/Wiki/Edit.pm index fabeb0c..d05e7a0 100644 --- a/lib/Narwhal/Component/Wiki/Edit.pm +++ b/lib/Narwhal/Component/Wiki/Edit.pm @@ -1,29 +1,7 @@ package Narwhal::Component::Wiki::Edit; use Moose; -has kioku => ( - isa => 'KiokuX::Model', - required => 1, - handles => 'KiokuDB::Role::API', -); - -has tt => ( - isa => 'Template', - required => 1, - handles => ['process'], -); - -has scope => ( - is => 'ro', - isa => 'KiokuDB::LiveObjects::Scope', - lazy => 1, - default => sub { shift->new_scope }, -); - -sub BUILD { - my $self = shift; - $self->scope; -} +with 'Narwhal::Component::Role::Wiki'; sub get { my $self = shift; diff --git a/lib/Narwhal/Component/Wiki/Page.pm b/lib/Narwhal/Component/Wiki/Page.pm index 726439a..09cdb34 100644 --- a/lib/Narwhal/Component/Wiki/Page.pm +++ b/lib/Narwhal/Component/Wiki/Page.pm @@ -1,29 +1,7 @@ package Narwhal::Component::Wiki::Page; use Moose; -has kioku => ( - isa => 'KiokuX::Model', - required => 1, - handles => 'KiokuDB::Role::API', -); - -has tt => ( - isa => 'Template', - required => 1, - handles => ['process'], -); - -has scope => ( - is => 'ro', - isa => 'KiokuDB::LiveObjects::Scope', - lazy => 1, - default => sub { shift->new_scope }, -); - -sub BUILD { - my $self = shift; - $self->scope; -} +with 'Narwhal::Component::Role::Wiki'; sub get { my $self = shift; |