blib/lib/VM/EC2/DB/Option/Group.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 38 CC 3 SCAR 16.7
CC
3
Cov
0%
Options
12.0
valid_fields
2.0
AllowsVpcAndNonVpcInstanceMemberships
2.0
CRAP 5.3
1 package VM::EC2::DB::Option::Group;
2  
3 =head1 NAME
4  
5 VM::EC2::DB::Option::Group - An RDS Database Option Group
6  
7 =head1 SYNOPSIS
8  
9 use VM::EC2;
10  
11 $ec2 = VM::EC2->new(...);
12 @grps = $ec2->describe_option_groups();
13 print $_->OptionGroupName,': ',$_->EngineName,"\n" foreach @grps;
14  
15 =head1 DESCRIPTION
16  
17 This object represents a DB Option Group. It is the result of a
18 VM::EC2->create_option_group(), VM::EC2->describe_option_groups(), or
19 VM::EC2->modify_option_group() call.
20  
21 =head1 STRING OVERLOADING
22  
23 In string context, the object returns the Option Group Name.
24  
25 =head1 SEE ALSO
26  
27 L<VM::EC2>
28 L<VM::EC2::Generic>
29 L<VM::EC2::DB::Instance>
30  
31 =head1 AUTHOR
32  
33 Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.
34  
35 Copyright (c) 2013 Loyalty Methods, Inc.
36  
37 This package and its accompanying libraries is free software; you can
38 redistribute it and/or modify it under the terms of the GPL (either
39 version 1, or at your option, any later version) or the Artistic
40 License 2.0. Refer to LICENSE for the full license text. In addition,
41 please see DISCLAIMER.txt for disclaimers of warranty.
42  
43 =cut
44  
45 use strict;
46 use base 'VM::EC2::Generic';
47 use VM::EC2::DB::Option;
48  
49 use overload '""' => sub { shift->OptionGroupName },
50 fallback => 1;
51  
52 sub valid_fields {
53 my $self = shift;
54 return qw(AllowsVpcAndNonVpcInstanceMemberships
55 EngineName
56 MajorEngineVersion
57 OptionGroupDescription
58 OptionGroupName
59 Options
60 VpcId);
61 }
62  
63 sub AllowsVpcAndNonVpcInstanceMemberships {
64 my $self = shift;
65 my $allows = $self->SUPER::AllowsVpcAndNonVpcInstanceMemberships;
66 return $allows eq 'true';
67 }
68  
69 sub Options {
70 my $self = shift;
71 my $options = $self->SUPER::Options;
72 return unless $options;
73 $options = $options->{Option};
74 return ref $options eq 'HASH' ?
75 (VM::EC2::DB::Option->new($options,$self->aws)) :
76 map { VM::EC2::DB::Option->new($_,$self->aws) } @$options;
77 }
78  
79 1;