Changeset 44 in bookmarks for trunk


Ignore:
Timestamp:
05/31/13 14:56:12 (12 years ago)
Author:
peter
Message:
  • make the id, ctime, and mtime attributes of Bookmark read-only
  • mtime defaults to the ctime
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bookmark.pm

    r25 r44  
    33use Moose; 
    44 
    5 has id    => ( is => 'rw' ); 
     5has id    => ( is => 'ro' ); 
    66has uri   => ( is => 'rw' ); 
    77has title => ( is => 'rw' ); 
    8 has ctime => ( is => 'rw' ); 
    9 has mtime => ( is => 'rw' ); 
     8has ctime => ( is => 'ro' ); 
     9has mtime => ( 
     10    is => 'ro', 
     11    # mtime defaults to ctime 
     12    default => sub { $_[0]->ctime }, 
     13    lazy => 1, 
     14); 
    1015has tags  => ( is => 'rw' ); 
    1116has bookmark_uri => ( is => 'rw' ); 
Note: See TracChangeset for help on using the changeset viewer.