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