| 1 | =head1 NAME | ||
| 2 | |||
| 3 | App::LinkSite::Section | ||
| 4 | |||
| 5 | =head1 SYNOPSIS | ||
| 6 | |||
| 7 | (You probably want to just look at the L<linksite> application.) | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | A class to model a section of links on a link site (part of App::LinkSite). | ||
| 12 | |||
| 13 | =cut | ||
| 14 | |||
| 15 | 2 | ▶ | use Feature::Compat::Class; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | 2 | class App::LinkSite::Section { | |
| 18 | 2 | our $VERSION = '0.1.3'; | |
| 19 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 2 | ▶ | no if $] >= 5.038, 'warnings', 'experimental::class'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 2 | field $title :reader :param; | |
| 24 | 2 | field $links :reader :param = []; | |
| 25 | |||
| 26 | =head1 METHODS | ||
| 27 | |||
| 28 | =head2 has_links | ||
| 29 | |||
| 30 | Returns true if this section has any links. | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | 2 | ▶ | method has_links { |
|
Subroutine
has_links: called CC=1 SCAR=0.0
Pod
documented
| |||
| 35 | 2 | return scalar @$links > 0; | |
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | =head1 AUTHOR | ||
| 40 | |||
| 41 | Dave Cross <dave@davecross.co.uk> | ||
| 42 | |||
| 43 | =head1 COPYRIGHT AND LICENCE | ||
| 44 | |||
| 45 | Copyright (c) 2024, Magnum Solutions Ltd. All Rights Reserved. | ||
| 46 | |||
| 47 | This library is free software; you can redistribute it and/or modify it | ||
| 48 | under the same terms as Perl itself. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | 2 | 1; | |