| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Dancer2::Plugin::PageHistory::Page; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Dancer2::Plugin::PageHistory::Page - Page object for Dancer2::Plugin::PageHistory |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=cut |
|
8
|
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
94870
|
use Moo; |
|
|
5
|
|
|
|
|
15785
|
|
|
|
5
|
|
|
|
|
21
|
|
|
10
|
5
|
|
|
5
|
|
3239
|
use Dancer2::Core::Types qw(Str HashRef); |
|
|
5
|
|
|
|
|
11900
|
|
|
|
5
|
|
|
|
|
320
|
|
|
11
|
5
|
|
|
5
|
|
786
|
use namespace::clean; |
|
|
5
|
|
|
|
|
15483
|
|
|
|
5
|
|
|
|
|
26
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head2 attributes |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Extra attributes as a hash reference, e.g.: SKU for a product page. |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has attributes => ( |
|
22
|
|
|
|
|
|
|
is => 'ro', |
|
23
|
|
|
|
|
|
|
isa => HashRef, |
|
24
|
|
|
|
|
|
|
predicate => 1, |
|
25
|
|
|
|
|
|
|
); |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 path |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Absolute path of the page. This is the only required attribute. |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has path => ( |
|
34
|
|
|
|
|
|
|
is => 'ro', |
|
35
|
|
|
|
|
|
|
isa => Str, |
|
36
|
|
|
|
|
|
|
required => 1, |
|
37
|
|
|
|
|
|
|
); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 query_string |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The original query string |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has query_string => ( |
|
46
|
|
|
|
|
|
|
is => 'ro', |
|
47
|
|
|
|
|
|
|
isa => Str, |
|
48
|
|
|
|
|
|
|
); |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 title |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Page title. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has title => ( |
|
57
|
|
|
|
|
|
|
is => 'ro', |
|
58
|
|
|
|
|
|
|
isa => Str, |
|
59
|
|
|
|
|
|
|
predicate => 1, |
|
60
|
|
|
|
|
|
|
); |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 METHODS |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 predicates |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
The following predicate methods are defined: |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=over |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item * has_attributes |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * has_title |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=back |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 uri |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Returns the string URI for L and L. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub uri { |
|
83
|
42
|
|
|
42
|
1
|
6813
|
my $self = shift; |
|
84
|
42
|
|
|
|
|
65
|
my $uri = $self->path; |
|
85
|
42
|
100
|
|
|
|
99
|
$uri .= '?' . $self->query_string if $self->query_string; |
|
86
|
42
|
|
|
|
|
141
|
return "$uri"; |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |