Chef/Recipe.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 36 CC 1 SCAR 6.9
CC
1
Cov
0%
add_resource
2.0
prepare_json
2.0
BEGIN
2.0
CRAP 2.0
1 package Chef::Recipe;
2  
3 use warnings;
4 use strict;
5  
6 use Moose;
7 use JSON;
8 use Data::Dumper;
9  
10 has 'resource_collection' =>
11 ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
12  
13 sub add_resource {
14 my $self = shift;
15  
16 foreach my $resource (@_) {
17 push( @{ $self->{'resource_collection'} }, $resource );
18 }
19  
20 1;
21 }
22  
23 sub prepare_json {
24 my $self = shift;
25 my @resource_collection;
26 foreach my $resource ( @{ $self->resource_collection } ) {
27 push( @resource_collection, $resource->prepare_json );
28 }
29 return \@resource_collection;
30 }
31  
32 =head1 COPYRIGHT & LICENSE
33  
34 Copyright 2009 Opscode, Inc., all rights reserved.
35  
36 This program is free software; you can redistribute it and/or modify it
37 under the same terms as Perl itself.
38  
39  
40 =cut
41  
42 1;