blib/lib/Net/ISC/DHCPd/OMAPI/Meta/Attribute.pm untested

filter: Statementstmt 0.0% 0 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 11 SCAR 6.9
CC
1
Cov
0%
has_action
2.0
BEGIN
2.0
CRAP 2.0
1 package Net::ISC::DHCPd::OMAPI::Meta::Attribute;
2  
3 =head1 NAME
4  
5 Net::ISC::DHCPd::OMAPI::Meta::Attribute - Attribute role for OMAPI attributes
6  
7 =cut
8  
9 use Moose::Role;
10  
11 =head1 ATTRIBUTES
12  
13 =head2 actions
14  
15 $array_ref = $attr->actions;
16  
17 Actions possible to execute on attribute. Can be:
18  
19 lookup
20 examine
21 update
22  
23 =cut
24  
25 has actions => (
26 is => 'ro',
27 isa => 'ArrayRef',
28 default => sub { [] },
29 );
30  
31 =head1 METHODS
32  
33 =head2 has_action
34  
35 $bool = $attr->has_action($action_name);
36  
37 Returns true if the attribute can execute C<$action_name>.
38  
39 =cut
40  
41 sub has_action {
42 return grep { $_[1] eq $_ } @{ $_[0]->actions };
43 }
44  
45 =head1 COPYRIGHT & LICENSE
46  
47 =head1 AUTHOR
48  
49 See L<Net::ISC::DHCPd>.
50  
51 =cut
52  
53 1;