diff options
Diffstat (limited to 'lib/Narwhal/Page.pm')
-rw-r--r-- | lib/Narwhal/Page.pm | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Narwhal/Page.pm b/lib/Narwhal/Page.pm index 70f2f87..829ce2e 100644 --- a/lib/Narwhal/Page.pm +++ b/lib/Narwhal/Page.pm @@ -5,17 +5,16 @@ use Narwhal::Page::Revision; with 'KiokuDB::Role::ID'; -has id => ( - is => 'ro', - isa => 'Str', - required => 1, -); - has current_revision => ( is => 'rw', isa => 'Narwhal::Page::Revision', required => 1, - handles => ['text', 'author', 'modification_date'], + handles => { + id => 'page_id', + text => 'text', + author => 'author', + modification_date => 'modification_date', + }, ); sub kiokudb_object_id { 'page:' . shift->id } @@ -31,9 +30,8 @@ sub new_page { my $class = shift; my %opts = @_; my $id = delete $opts{id}; - my $rev = Narwhal::Page::Revision->new(%opts); + my $rev = Narwhal::Page::Revision->new(page_id => $id, %opts); return $class->new( - id => $id, current_revision => $rev, ); } |