blib/lib/Net/DHCPv6/Option/ClientArchType.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 53 CC 3 SCAR 12.0
CC
3
Cov
0%
new
6.0
from_bytes_inner
6.0
type
2.0
CRAP 3.3
1 #!/bin/false
2 # ABSTRACT: Client System Architecture Type option (code 61) -- 16-bit architecture type
3 # PODNAME: Net::DHCPv6::Option::ClientArchType
4 use strictures 2;
5  
6 package Net::DHCPv6::Option::ClientArchType;
7 $Net::DHCPv6::Option::ClientArchType::VERSION = '0.002';
8 use Net::DHCPv6::OptionList;
9 use Carp qw( croak );
10 use Net::DHCPv6::Constants;
11 use Net::DHCPv6::X::BadOption;
12 use parent 'Net::DHCPv6::Option';
13 use namespace::clean;
14  
15 sub new {
16 my ( $class, %args ) = @_;
17 croak 'ClientArchType requires type' unless defined $args{type};
18 $args{code} = $OPTION_CLIENT_ARCH_TYPE;
19 $args{data} = pack( 'n', $args{type} );
20 my $self = $class->SUPER::new( %args );
21 $self->{type} = $args{type};
22 return bless $self, $class;
23 }
24  
25 sub type { return shift->{type} }
26  
27 sub from_bytes_inner {
28 my ( $class, $code, $payload ) = @_;
29 Net::DHCPv6::X::BadOption->throw( message => 'ClientArchType must be exactly 2 bytes' )
30 if CORE::length( $payload ) != 2;
31 my $type = unpack( 'n', $payload );
32 return $class->new( type => $type );
33 }
34  
35 $Net::DHCPv6::OptionList::OPTION_CLASS{$OPTION_CLIENT_ARCH_TYPE} = __PACKAGE__;
36 1;
37  
38 __END__