File Coverage

blib/lib/ElasticSearchX/Model/Document/Trait/Field/Timestamp.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of ElasticSearchX-Model
3             #
4             # This software is Copyright (c) 2019 by Moritz Onken.
5             #
6             # This is free software, licensed under:
7             #
8             # The (three-clause) BSD License
9             #
10             package ElasticSearchX::Model::Document::Trait::Field::Timestamp;
11             $ElasticSearchX::Model::Document::Trait::Field::Timestamp::VERSION = '2.0.1';
12 4     4   2426 use Moose::Role;
  4         41  
  4         28  
13 4     4   17967 use ElasticSearchX::Model::Document::Types qw(:all);
  4         10  
  4         23  
14              
15             has timestamp => (
16             is => 'rw',
17             isa => TimestampField,
18             coerce => 1,
19             predicate => 'has_timestamp',
20             );
21              
22             around mapping => sub { () };
23              
24             around type_mapping => sub {
25             my ( $orig, $self ) = @_;
26             return ( _timestamp => $self->timestamp );
27             };
28              
29             around field_name => sub {'_timestamp'};
30              
31             around query_property => sub {1};
32              
33             around property => sub {0};
34              
35             package ElasticSearchX::Model::Document::Trait::Class::Timestamp;
36             $ElasticSearchX::Model::Document::Trait::Class::Timestamp::VERSION = '2.0.1';
37 4     4   3917 use Moose::Role;
  4         11  
  4         19  
38              
39             1;
40              
41             __END__
42              
43             =pod
44              
45             =encoding UTF-8
46              
47             =head1 NAME
48              
49             ElasticSearchX::Model::Document::Trait::Field::Timestamp
50              
51             =head1 VERSION
52              
53             version 2.0.1
54              
55             =head1 AUTHOR
56              
57             Moritz Onken
58              
59             =head1 COPYRIGHT AND LICENSE
60              
61             This software is Copyright (c) 2019 by Moritz Onken.
62              
63             This is free software, licensed under:
64              
65             The (three-clause) BSD License
66              
67             =cut