- Timestamp:
- 06/04/15 22:00:25 (9 years ago)
- Location:
- trunk/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Bookmarks.pm
r84 r88 7 7 8 8 use Bookmark; 9 use Bookmarks::List;10 9 use Bookmarks::Search; 11 10 … … 100 99 } 101 100 102 sub get_bookmarks{101 sub search { 103 102 my $self = shift; 104 103 my $params = shift || {}; … … 130 129 }); 131 130 } 132 return Bookmarks::List->new({ 133 bookmarks => $self, 134 search => $search, 135 results => \@resources, 136 }); 131 $search->results(\@resources); 132 133 return $search; 137 134 } 138 135 -
trunk/lib/Bookmarks/Controller.pm
r75 r88 7 7 use JSON; 8 8 use Bookmarks; 9 use Bookmarks::List; 9 10 use URI; 10 11 use Template; … … 83 84 my $offset = $self->request->param('offset'); 84 85 85 my $list = $self->bookmarks->get_bookmarks({ 86 query => $query, 87 tags => \@tags, 88 limit => $limit, 89 offset => $offset, 86 my $list = Bookmarks::List->new({ 87 bookmarks => $self->bookmarks, 88 search => $self->bookmarks->search({ 89 query => $query, 90 tags => \@tags, 91 limit => $limit, 92 offset => $offset, 93 }), 90 94 }); 91 95 … … 104 108 105 109 # construct a feed from the most recent 12 bookmarks 106 my $list = $self->bookmarks->get_bookmarks({ query => $query, tags => \@tags, limit => 12 }); 110 my $list = Bookmarks::List->new({ 111 bookmarks => $self->bookmarks, 112 search => $self->bookmarks->search({ query => $query, tags => \@tags, limit => 12 }), 113 }); 107 114 return $list->as_atom; 108 115 } -
trunk/lib/Bookmarks/List.pm
r71 r88 13 13 is => 'ro', 14 14 isa => 'Bookmarks::Search', 15 handles => [qw{query tags limit offset }],15 handles => [qw{query tags limit offset results}], 16 16 ); 17 has results => ( is => 'ro' );18 17 has title => ( 19 18 is => 'ro', -
trunk/lib/Bookmarks/Search.pm
r71 r88 11 11 has offset => (is => 'ro'); 12 12 13 has results => (is => 'rw', default => sub { [] }); 14 13 15 # module return 14 16 1;
Note: See TracChangeset
for help on using the changeset viewer.