File Coverage

blib/lib/Lingua/StarDict/Writer/Entry/Part.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Lingua::StarDict::Writer::Entry::Part;
2              
3 2     2   36 use 5.006;
  2         8  
4 2     2   15 use strict;
  2         4  
  2         45  
5 2     2   11 use warnings;
  2         5  
  2         45  
6 2     2   11 use Moo;
  2         3  
  2         22  
7              
8              
9             =encoding utf8
10             =cut
11              
12             =head1 NAME
13              
14             Lingua::StarDict::Writer::Entry::Part - an internal module for Lingua::StarDict::Writer. Please read L manual.
15              
16             =cut
17              
18             has 'type' => (
19             is => 'rw',
20             default => "m",
21             isa => sub {
22             my $type = shift;
23             die "Error setting part type ". (defined $type ? "'type'": "undef") .": Part type should be one latin letter" unless defined $type && $type =~ /^[a-zA-Z]$/;
24             die "Error setting part type '$type': Binary (upper case) part types are not supported" unless $type =~ /^[a-z]$/;
25             }
26             );
27              
28             has 'data' => (
29             is => 'rw',
30             required => 1,
31             );
32              
33              
34             =head1 LICENSE AND COPYRIGHT
35              
36             Copyright 2021 Nikolay Shaplov.
37              
38             This program is free software; you can redistribute it and/or modify it
39             under the terms of the the Artistic License (2.0). You may obtain a
40             copy of the full license at:
41              
42             L
43              
44             Any use, modification, and distribution of the Standard or Modified
45             Versions is governed by this Artistic License. By using, modifying or
46             distributing the Package, you accept this license. Do not use, modify,
47             or distribute the Package, if you do not accept this license.
48              
49             If your Modified Version has been derived from a Modified Version made
50             by someone other than you, you are nevertheless required to ensure that
51             your Modified Version complies with the requirements of this license.
52              
53             This license does not grant you the right to use any trademark, service
54             mark, tradename, or logo of the Copyright Holder.
55              
56             This license includes the non-exclusive, worldwide, free-of-charge
57             patent license to make, have made, use, offer to sell, sell, import and
58             otherwise transfer the Package with respect to any patent claims
59             licensable by the Copyright Holder that are necessarily infringed by the
60             Package. If you institute patent litigation (including a cross-claim or
61             counterclaim) against any party alleging that the Package constitutes
62             direct or contributory patent infringement, then this Artistic License
63             to you shall terminate on the date that such litigation is filed.
64              
65             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
66             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
67             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
68             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
69             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
70             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
71             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
72             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73              
74              
75             =cut
76              
77             1;