Moose/Field.pm

filter: Statementstmt 63.1% 12 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 50.0% 1 / 2 totaltotal 55.1% 16 / 29 CC 2 SCAR 9.5
CC
2
Cov
57%
clone
6.0
as_formatted
2.0
__ANON__
1.1
CRAP 2.6
« Moose/Formater/Json.pm ↑ Summary Moose.pm »
1 package MARC::Moose::Field;
2 # ABSTRACT: Marc field base object
3 4 $MARC::Moose::Field::VERSION = '1.0.46';
4 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 subtype 'Tag'
8 => as 'Str'
9 160 ▶ => where { $_ =~ /^\w{3}$/ }
Subroutine __ANON__: called CC=1 SCAR=0.0
10 0 ▶ => message { 'A 3 alphanumeric characters is required' };
Subroutine __ANON__: not called CC=1 SCAR=1.2
11  
12 4 has tag => ( is => 'rw', isa => 'Tag', required => 1, );
13  
14  
15 sub clone {
16 0 ▶ my ($self, $tag) = @_;
Subroutine clone: not called CC=2 SCAR=17.9
Pod documented
17  
18 0 my $field = MARC::Moose::Field->new( tag => $self->tag );
19 0 ▶ $field->tag($tag) if $tag;
Branch: 1 branch
BranchTrueFalseTotal
if $tag 0 0 0
20 0 return $field;
21 }
22  
23  
24 sub as_formatted {
25 0 ▶ my $self = shift;
Subroutine as_formatted: not called CC=1 SCAR=6.9
Pod undocumented
26 0 return $self->tag;
27 }
28  
29 4 __PACKAGE__->meta->make_immutable;
30  
31 4 1;
32  
33 __END__
34  
35 =pod
36  
37 =encoding UTF-8
38  
39 =head1 NAME
40  
41 MARC::Moose::Field - Marc field base object
42  
43 =head1 VERSION
44  
45 version 1.0.46
46  
47 =head1 ATTRIBUTES
48  
49 =head2 tag
50  
51 3-alphanumerics identifing a field. Required.
52  
53 =head1 METHODS
54  
55 =head2 clone([$tag])
56  
57 Return a new field cloning the field. If tag is provided, the cloned field tag
58 is changed.
59  
60 =head1 SEE ALSO
61  
62 =over 4
63  
64  
65  
66 =back
67  
68 * L<MARC::Moose::Field::Control>
69 * L<MARC::Moose::Field::Std>
70  
71 =head1 AUTHOR
72  
73 Frédéric Demians <f.demians@tamil.fr>
74  
75 =head1 COPYRIGHT AND LICENSE
76  
77 This software is copyright (c) 2022 by Frédéric Demians.
78  
79 This is free software; you can redistribute it and/or modify it under
80 the same terms as the Perl 5 programming language system itself.
81  
82 =cut
« Moose/Formater/Json.pm ↑ Summary Moose.pm »