File Coverage

blib/lib/Linux/LVM2/PV.pm
Criterion Covered Total %
statement 11 13 84.6
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 16 18 88.8


line stmt bran cond sub pod time code
1             package Linux::LVM2::PV;
2             {
3             $Linux::LVM2::PV::VERSION = '0.14';
4             }
5             BEGIN {
6 1     1   1765 $Linux::LVM2::PV::AUTHORITY = 'cpan:TEX';
7             }
8             # ABSTRACT: a class representing a PV in a Linux LVM2
9              
10 1     1   23 use 5.010_000;
  1         4  
  1         43  
11 1     1   6 use mro 'c3';
  1         3  
  1         6  
12 1     1   36 use feature ':5.10';
  1         3  
  1         97  
13              
14 1     1   509 use Moose;
  0            
  0            
15             use namespace::autoclean;
16              
17             # use IO::Handle;
18             # use autodie;
19             # use MooseX::Params::Validate;
20              
21             has 'name' => (
22             'is' => 'ro',
23             'isa' => 'Str',
24             'required' => 1,
25             );
26              
27             has 'vg' => (
28             'is' => 'ro',
29             'isa' => 'Linux::LVM2::VG',
30             'required' => 1,
31             'weak_ref' => 1,
32             );
33              
34             has 'size' => (
35             'is' => 'ro',
36             'isa' => 'Int',
37             'required' => 1,
38             );
39              
40             has 'pesize' => (
41             'is' => 'ro',
42             'isa' => 'Int',
43             'required' => 1,
44             );
45              
46             has 'totalpe' => (
47             'is' => 'ro',
48             'isa' => 'Int',
49             'required' => 1,
50             );
51              
52             has 'freepe' => (
53             'is' => 'ro',
54             'isa' => 'Int',
55             'required' => 1,
56             );
57              
58             has 'allocpe' => (
59             'is' => 'ro',
60             'isa' => 'Int',
61             'required' => 1,
62             );
63              
64             has 'uuid' => (
65             'is' => 'ro',
66             'isa' => 'Str',
67             'required' => 1,
68             );
69              
70             sub BUILD {
71             my $self = shift;
72              
73             $self->vg()->pvs()->{ $self->name() } = $self;
74              
75             return 1;
76             }
77              
78             no Moose;
79             __PACKAGE__->meta->make_immutable;
80              
81             1;
82              
83             __END__
84              
85             =pod
86              
87             =encoding utf-8
88              
89             =head1 NAME
90              
91             Linux::LVM2::PV - a class representing a PV in a Linux LVM2
92              
93             =head1 SYNOPSIS
94              
95             Instances of this class are usually create by Linux::LVM2::_find_vgs.
96              
97             =head1 DESCRIPTION
98              
99             This class models a physical-volume inside a Linux LVM2 setup.
100              
101             =head1 ATTRIBUTES
102              
103             =head2 name
104              
105             The name of this PV
106              
107             =head2 vg
108              
109             The VG that is using this PV
110              
111             =head2 size
112              
113             The size of this PV
114              
115             =head2 pesize
116              
117             UNDOCUMENTED
118              
119             =head2 totalpe
120              
121             UNDOCUMENTED
122              
123             =head2 freepe
124              
125             UNDOCUMENTED
126              
127             =head2 allocpe
128              
129             UNDOCUMENTED
130              
131             =head2 uuid
132              
133             UNDOCUMENTED
134              
135             =head1 METHODS
136              
137             =head2 BUILD
138              
139             Invoked by Moose on instantiation. Sets a reference to this class in our parent
140             VG.
141              
142             =head1 NAME
143              
144             Linux::LVM2::PV - Model a physical-volume.
145              
146             =head1 AUTHOR
147              
148             Dominik Schulz <dominik.schulz@gauner.org>
149              
150             =head1 COPYRIGHT AND LICENSE
151              
152             This software is copyright (c) 2012 by Dominik Schulz.
153              
154             This is free software; you can redistribute it and/or modify it under
155             the same terms as the Perl 5 programming language system itself.
156              
157             =cut