summaryrefslogtreecommitdiff
path: root/lib/DeWeave/BO/History.pm
blob: 8a3c78967c4e389b573837b106423fa46b27f27d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package DeWeave::BO::History; 
use Moose;
use namespace::autoclean;
use MooseX::Types::Moose qw(Str ArrayRef Int);
use MooseX::Types::Structured qw(Dict);
 
extends 'DeWeave::EDO';
 
has histUri => (
    isa => Str,
    required => 1,
    is => 'ro',
);
 
has title => (
    isa => Str,
    required => 0,
    is => 'ro',
);
 
has visits => (
    isa => ArrayRef[Dict[date => Int, type => Int]],
    required => 1,
    is => 'ro',
);
 
{
my @visit_types=(
    undef,
    'link',
    'typed',
    'bookmark',
    'embed',
    'redirect_permanent',
    'redirect_temporary',
    'download',
    'framed_link',
);
sub visit_type {
    my ($self,$type_int) = @_;
 
    if ($type_int > 0 && $type_int < @visit_types) {
        return $visit_types[$type_int];
    }
    return undef;
}
}
 
1;
 
__END__
 
=head1 AUTHOR
 
Gianni Ceccarelli <dakkar@thenautilus.net>
 
=head1 COPYRIGHT AND LICENSE
 
This software is copyright (c) 2012 by Gianni Ceccarelli.
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, version 3.
 
=cut