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

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 54 CC 5 SCAR 18.9
CC
5
Cov
0%
OptionGroupOptionSettings
12.0
OptionsDependedOn
12.0
valid_fields
2.0
CRAP 6.6
1 package VM::EC2::DB::Option::Group::Option;
2  
3 =head1 NAME
4  
5 VM::EC2::DB::Option::Group::Option - An RDS Database Option Group Option
6  
7 =head1 SYNOPSIS
8  
9 use VM::EC2;
10  
11 $ec2 = VM::EC2->new(...);
12 @options = $ec2->describe_option_group_options(-engine_name => 'oracle-se1');
13 foreach $option (@options) {
14 print $option->Name,' ',$option->MajorEngineVersion,"\n";
15 }
16  
17 =head1 DESCRIPTION
18  
19 This object represents an Option Group Option, as returned by the
20 VM::EC2->describe_option_group_options() call.
21  
22 =head1 STRING OVERLOADING
23  
24 In string context, the object returns the Option Name.
25  
26 =head1 SEE ALSO
27  
28 L<VM::EC2>
29 L<VM::EC2::Generic>
30 L<VM::EC2::DB::Instance>
31  
32 =head1 AUTHOR
33  
34 Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>.
35  
36 Copyright (c) 2013 Loyalty Methods, Inc.
37  
38 This package and its accompanying libraries is free software; you can
39 redistribute it and/or modify it under the terms of the GPL (either
40 version 1, or at your option, any later version) or the Artistic
41 License 2.0. Refer to LICENSE for the full license text. In addition,
42 please see DISCLAIMER.txt for disclaimers of warranty.
43  
44 =cut
45  
46 use strict;
47 use base 'VM::EC2::Generic';
48 use VM::EC2::DB::Option::Group::Option::Setting;
49  
50 use overload '""' => sub { shift->Name },
51 fallback => 1;
52  
53 sub valid_fields {
54 my $self = shift;
55 return qw(
56 DefaultPort
57 Description
58 EngineName
59 MajorEngineVersion
60 MinimumRequiredMinorEngineVersion
61 Name
62 OptionGroupOptionSettings
63 OptionsDependedOn
64 Persistent
65 PortRequired
66 );
67 }
68  
69 sub OptionGroupOptionSettings {
70 my $self = shift;
71 my $settings = $self->SUPER::OptionGroupOptionSettings;
72 return unless $settings;
73 $settings = $settings->{OptionGroupOptionSetting};
74 return ref $settings eq 'HASH' ?
75 (VM::EC2::Option::Group::Option::Setting->new($settings,$self->aws)) :
76 map { VM::EC2::Option::Group::Option::Setting->new($_,$self->aws) } @$settings;
77 }
78  
79 sub OptionsDependedOn {
80 my $self = shift;
81 my $depend = $self->SUPER::OptionsDependedOn;
82 return unless $depend;
83 $depend = $depend->{OptionName};
84 return ref $depend eq 'ARRAY' ? @$depend : ($depend);
85 }
86  
87 sub Persistent {
88 my $self = shift;
89 my $p = $self->SUPER::Persistent;
90 return $p eq 'true';
91 }
92  
93 sub PortRequired {
94 my $self = shift;
95 my $pr = $self->SUPER::PortRequired;
96 return $pr eq 'true';
97 }
98  
99 1;