File Coverage

blib/lib/WWW/GoDaddy/REST/Collection.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod 1 1 100.0
total 9 9 100.0


line stmt bran cond sub pod time code
1             package WWW::GoDaddy::REST::Collection;
2              
3 2     2   880 use Moose;
  2         3  
  2         14  
4              
5             extends 'WWW::GoDaddy::REST::Resource';
6              
7             sub items {
8 3     3 1 3 my $self = shift;
9 3         4 return @{ $self->f_as_resources('data') };
  3         15  
10             }
11              
12             1;
13              
14             =head1 NAME
15              
16             WWW::GoDaddy::REST::Collection - collection specific resource class
17              
18             =head1 SYNOPSIS
19              
20             $collection = $client->query('myschema',{ 'f' => 'v' });
21              
22             # every method from WWW::GoDaddy::REST::Resource is
23             # available. Here are the differences.
24            
25             @items = $collection->items();
26              
27             =head1 DESCRIPTION
28              
29             This is used to represent 'collections' which are very common in the Go Daddy(r)
30             API specification.
31              
32             It is a sub class of L<WWW::GoDaddy::REST::Resoure>.
33              
34             =head1 ATTRIBUTES
35              
36             See L<WWW::GoDaddy::REST::Resource>.
37              
38             =head1 METHODS
39              
40             See L<WWW::GoDaddy::REST::Resource> for more.
41              
42             =over 4
43              
44             =item items
45              
46             Returns the list of resources in the collection.
47              
48             This overrides the C<items> method in L<WWW::GoDaddy::REST::Resource>.
49              
50             =back
51              
52             =head1 CLASS METHODS
53              
54             See L<WWW::GoDaddy::REST::Resource> for more.
55              
56             =head1 AUTHOR
57              
58             David Bartle, C<< <davidb@mediatemple.net> >>
59              
60             =head1 COPYRIGHT & LICENSE
61              
62             Copyright (c) 2014 Go Daddy Operating Company, LLC
63              
64             Permission is hereby granted, free of charge, to any person obtaining a
65             copy of this software and associated documentation files (the "Software"),
66             to deal in the Software without restriction, including without limitation
67             the rights to use, copy, modify, merge, publish, distribute, sublicense,
68             and/or sell copies of the Software, and to permit persons to whom the
69             Software is furnished to do so, subject to the following conditions:
70              
71             The above copyright notice and this permission notice shall be included in
72             all copies or substantial portions of the Software.
73              
74             THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
75             IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
76             FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
77             THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
78             LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
79             FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
80             DEALINGS IN THE SOFTWARE.
81              
82             =cut
83