IDL/Struct.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 80.0% 4 / 5 totaltotal 60.0% 21 / 35 CC 1 SCAR 4.1
CC
1
Cov
59%
to_str
2.0
fields
2.0
field_named
2.0
CRAP 1.5
« IDL/Document.pm ↑ Summary IDL/Type/Map.pm »
1 package Thrift::IDL::Struct;
2  
3 =head1 NAME
4  
5 Thrift::IDL::Struct
6  
7 =head1 DESCRIPTION
8  
9 Inherits from L<Thrift::IDL::Definition>
10  
11 =cut
12  
13 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use base qw(Thrift::IDL::Definition);
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 __PACKAGE__->mk_accessors(qw(name children));
17  
18 =head1 METHODS
19  
20 =head2 name
21  
22 =head2 children
23  
24 Scalar accessors
25  
26 =head2 fields
27  
28 Returns array ref of L<Thrift::IDL::Field> children
29  
30 =head2 field_named ($name)
31  
32 =head2 field_id ($id)
33  
34 Returns object found in fields array with given key value
35  
36 =cut
37  
38 0 ▶sub to_str {
Subroutine to_str: not called CC=1 SCAR=6.9
Pod undocumented
39 return $_[0]->name . ' ('
40 0 . join (', ', map { '' . $_ } @{ $_[0]->fields })
41 . ')';
42 }
43  
44 0 ▶sub fields {
Subroutine fields: not called CC=1 SCAR=6.9
Pod documented
45 0 my $self = shift;
46 0 $self->children_of_type('Thrift::IDL::Field');
47 }
48  
49 0 ▶sub field_named {
Subroutine field_named: not called CC=1 SCAR=6.9
Pod documented
50 0 my ($self, $name) = @_;
51 0 $self->array_search($name, 'fields', 'name');
52 }
53  
54 0 ▶sub field_id {
Subroutine field_id: not called CC=1 SCAR=6.9
Pod documented
55 0 my ($self, $name) = @_;
56 0 $self->array_search($name, 'fields', 'id');
57 }
58  
59 3 ▶sub setup {
Subroutine setup: called CC=1 SCAR=0.0
Pod documented
60 3 my $self = shift;
61 3 $self->_setup('children');
62 }
63  
64 4 1;
« IDL/Document.pm ↑ Summary IDL/Type/Map.pm »