Changeset 61 in bookmarks for trunk/BookmarkController.pm


Ignore:
Timestamp:
08/23/13 16:50:59 (11 years ago)
Author:
peter
Message:
  • wrap the creation of the Bookmarks object into the BookmarkController
  • bookmark is a lazy-loaded read-only attribute with a builder in BookmarkController
  • made dbname and request required attributes of BookmarkController
  • updated the api notes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BookmarkController.pm

    r59 r61  
    99use Template; 
    1010 
     11has dbname => ( 
     12    is => 'ro', 
     13    required => 1, 
     14); 
    1115has bookmarks => ( 
    12     is => 'rw', 
     16    is => 'ro', 
    1317    handles => [qw{get_bookmark}], 
     18    builder => '_build_bookmarks', 
     19    lazy => 1, 
    1420); 
    1521has base_uri => ( 
     
    2026has request => ( 
    2127    is => 'ro', 
     28    required => 1, 
    2229); 
     30 
     31sub _build_bookmarks { 
     32    my $self = shift; 
     33    return Bookmarks->new({ 
     34        dbname   => $self->dbname, 
     35        base_uri => $self->base_uri, 
     36    }); 
     37} 
    2338 
    2439sub _build_base_uri { 
Note: See TracChangeset for help on using the changeset viewer.