| 1 | package Template::Plugin::Calendar::Simple; | ||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 4 | ▶ | use warnings FATAL => 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | our $VERSION = '1.04'; | |||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use Calendar::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | ▶ | use Template::Plugin; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 4 | ▶ | use Template::Iterator; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | ▶ | use Template::Exception; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 4 | ▶ | use base qw( Template::Plugin ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 2 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 13 | 2 | my ($class, $context, @args) = @_; | |||||||||
| 14 | 2 | my @cal = Calendar::Simple::calendar( @args ); | |||||||||
| 15 | 2 | return bless { | |||||||||
| 16 | _CONTEXT => $context, | ||||||||||
| 17 | rows => Template::Iterator->new( [@cal] ), | ||||||||||
| 18 | days => [qw( Sun Mon Tue Wed Thu Fri Sat )], | ||||||||||
| 19 | }, $class; | ||||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 2 | ▶ | sub rows { | ||||||||
|
Subroutine
rows: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 23 | 2 | my ($self) = shift; | |||||||||
| 24 | 2 | return $self->{rows}; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 2 | ▶ | sub days { | ||||||||
|
Subroutine
days: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | 2 | my ($self, $monday_starts_week) = @_; | |||||||||
| 29 | 2 | my @days = @{ $self->{days} }; | |||||||||
| 30 | 2 | ▶ | push @days, shift @days if $monday_starts_week; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 2 | return [@days]; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 4 | 1; | |||||||||
| 35 | __END__ | ||||||||||