blib/lib/VM/EC2/DB/SecurityGroup/Membership.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 30 CC 1 SCAR 6.9
CC
1
Cov
0%
valid_fields
2.0
name
2.0
status
2.0
CRAP 2.0
1 package VM::EC2::DB::SecurityGroup::Membership;
2  
3 =head1 NAME
4  
5 VM::EC2::DB::SecurityGroup::Membership - An RDS Database Security Group Membership
6  
7 =head1 SYNOPSIS
8  
9 use VM::EC2;
10 $ec2 = VM::EC2->new(...);
11 my $db = $ec2->describe_db_instance(...);
12 my @grps = $db->DBSecurityGroups;
13  
14 =head1 METHODS
15  
16 DBSecurityGroupName -- The security group name
17  
18 Status -- The security group status
19  
20 name -- Alias for DBSecurityGroupName
21  
22 status -- Alias for Status
23  
24 db_security_group -- returns an VM::EC2::DB::SecurityGroup object
25  
26 =head1 DESCRIPTION
27  
28 This object describes a DB Security Group Membership. It is a response element
29 in calls that return a DB instance object.
30  
31 =head1 STRING OVERLOADING
32  
33 In string context, the object returns the Security Group Name.
34  
35 =head1 SEE ALSO
36  
37 L<VM::EC2>
38 L<VM::EC2::Generic>
39 L<VM::EC2::DB::Instance>
40  
41 =head1 AUTHOR
42  
43 Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.
44  
45 Copyright (c) 2013 Loyalty Methods, Inc.
46  
47 This package and its accompanying libraries is free software; you can
48 redistribute it and/or modify it under the terms of the GPL (either
49 version 1, or at your option, any later version) or the Artistic
50 License 2.0. Refer to LICENSE for the full license text. In addition,
51 please see DISCLAIMER.txt for disclaimers of warranty.
52  
53 =cut
54  
55 use strict;
56 use base 'VM::EC2::Generic';
57  
58 use overload '""' => sub { shift->DBSecurityGroupName },
59 fallback => 1;
60  
61 sub valid_fields {
62 my $self = shift;
63 return qw(DBSecurityGroupName Status);
64 }
65  
66 sub name { shift->DBSecurityGroupName }
67  
68 sub status { shift->Status }
69  
70 sub db_security_group {
71 my $self = shift;
72 my $name = $self->DBSecurityGroupName or return;
73 return $self->aws->describe_db_security_groups(-db_security_group_name => $name);
74 }
75  
76 1;