[libcatmandu-perl] 35/46: Adding basic documentation for Catmandu::Paged
Jonas Smedegaard
dr at jones.dk
Tue Oct 14 13:52:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.9205
in repository libcatmandu-perl.
commit a54769b946ee39747cb50462146eaee609540f24
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date: Fri Sep 26 14:26:35 2014 +0200
Adding basic documentation for Catmandu::Paged
---
lib/Catmandu/Paged.pm | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/lib/Catmandu/Paged.pm b/lib/Catmandu/Paged.pm
index 2f02764..7123027 100644
--- a/lib/Catmandu/Paged.pm
+++ b/lib/Catmandu/Paged.pm
@@ -1,5 +1,49 @@
package Catmandu::Paged;
+=head1 NAME
+
+Catmandu::Pages - Adds page calculation to a package
+
+=head1 SYNOPSIS
+
+ package MyPackage;
+
+ use Moo;
+
+ with 'Catmandu::Pages';
+
+ sub start {
+ 12; # Starting result
+ }
+
+ sub limit {
+ 10; # Number of results per page
+ }
+
+ sub total {
+ 131237128371; # Total number of results;
+ }
+
+ package main;
+
+ my $x = MyPackage->new;
+
+ $x->first_page;
+ $x->last_page;
+ $x->page_size;
+ $x->page; # current page
+ $x->previous_page;
+ $x->next_page;
+ $x->first_on_page;
+ $x->next;
+ $x->page_ranges;
+ $x->pages_in_spread;
+
+=head1 SEE ALSO
+
+L<Catmandu::Hits>
+
+=cut
use namespace::clean;
use Catmandu::Sane;
use Moo::Role;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git
More information about the Pkg-perl-cvs-commits
mailing list