Changeset 24 in bookmarks
- Timestamp:
- 05/22/13 21:24:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BookmarkApp.pm
r22 r24 21 21 my $bookmarks = Bookmarks->new({ 22 22 dbname => $dbname, 23 base_uri => $base_uri ->canonical,23 base_uri => $base_uri, 24 24 }); 25 25 -
trunk/Bookmarks.pm
r20 r24 3 3 use Moose; 4 4 use SQL::Interp qw{:all}; 5 use URI; 5 6 use Bookmark; 6 7 7 8 has dbh => ( is => 'rw' ); 8 has base_uri => ( is => 'ro' );9 has base_uri => ( is => 'ro', isa => 'URI' ); 9 10 10 11 sub BUILD { … … 44 45 $bookmark->{tags} = [ map { $$_[0] } @{ $sth_tag->fetchall_arrayref } ]; 45 46 if ($self->base_uri) { 46 $bookmark->{bookmark_uri} = $self->base_uri . $bookmark->{id};47 $bookmark->{bookmark_uri} = URI->new_abs($bookmark->{id}, $self->base_uri); 47 48 } 48 49 } … … 90 91 $resource->{tags} = [ map { $$_[0] } @{ $sth_tag->fetchall_arrayref } ]; 91 92 if ($self->base_uri) { 92 $resource->{bookmark_uri} = $self->base_uri . $resource->{id};93 $resource->{bookmark_uri} = URI->new_abs($resource->{id}, $self->base_uri); 93 94 } 94 95 push @resources, $resource;
Note: See TracChangeset
for help on using the changeset viewer.