File Coverage

blib/lib/Device/WWN/EMC/Clariion.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Device::WWN::EMC::Clariion;
2 1     1   118475 use strict; use warnings;
  1     1   2  
  1         32  
  1         5  
  1         2  
  1         45  
3             our $VERSION = '1.01';
4 1     1   563 use Moose;
  0            
  0            
5             extends 'Device::WWN';
6             #use Carp::Clan qw{ ^Device::WWN($|::) croak };
7              
8             sub accept_wwn {
9             my ( $self, $wwn ) = @_;
10             return $wwn =~ /^5006016/;
11             }
12              
13             has 'port' => ( is => 'ro', isa => 'Str', lazy_build => 1 );
14             sub _build_port {
15             my $self = shift;
16             my $id = hex substr( $self->vendor_id, 0, 1 );
17             if ( $id >= 0 && $id <= 7 ) {
18             return sprintf( 'SPA%x', $id );
19             } elsif ( $id >= 8 && $id <= 15 ) {
20             return sprintf( 'SPB%x', $id - 8 );
21             }
22             }
23              
24             no Moose;
25             __PACKAGE__->meta->make_immutable;
26             1;
27             __END__
28              
29             =head1 NAME
30              
31             Device::WWN::EMC::Clariion - Device::WWN subclass for EMC CLARiiON WWNs
32              
33             =head1 SYNOPSIS
34              
35             use Device::WWN;
36             my $wwn = Device::WWN->new( TODO );
37             TODO
38              
39             =head1 DESCRIPTION
40              
41             This module is a subclass of L<Device::WWN|Device::WWN> which provides
42             additional information about EMC CLARiiON World Wide Names.
43              
44             See L<Device::WWN|Device::WWN> for more information.
45              
46             Note that there doesn't appear to be a way to extract a Clariion serial number
47             from it's WWN, all you can get is the port information.
48              
49             =head1 METHODS
50              
51             =head2 accept_wwn( $wwn )
52              
53             This is called as a class method by L<Device::WWN> and returns a true value
54             if the WWN provided can be handled by this subclass.
55              
56             =head2 port
57              
58             Returns the port the WWN belongs to.
59              
60             =head1 MODULE HOME PAGE
61              
62             The home page of this module is
63             L<http://www.jasonkohles.com/software/device-wwn>. This is where you can
64             always find the latest version, development versions, and bug reports. You
65             will also find a link there to report bugs.
66              
67             =head1 SEE ALSO
68              
69             L<Device::WWN|Device::WWN>
70              
71             L<http://www.jasonkohles.com/software/device-wwn>
72              
73             =head1 AUTHOR
74              
75             Jason Kohles C<< <email@jasonkohles.com> >>
76              
77             L<http://www.jasonkohles.com>
78              
79             =head1 COPYRIGHT AND LICENSE
80              
81             Copyright 2008, 2009 Jason Kohles
82              
83             This program is free software; you can redistribute it and/or modify it
84             under the same terms as Perl itself.
85              
86             =cut
87