Giddy/Collection/InMemory.pm

filter: Statementstmt 81.2% 13 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 2 / 5 Podpod 100% 1 / 1 totaltotal 72.7% 16 / 22 CC 1 SCAR 2.2
CC
1
Cov
81%
drop
2.0
__ANON__
1.1
__ANON__
1.1
CRAP 1.2
« Giddy/Role/PathMaker.pm ↑ Summary
1 package Giddy::Collection::InMemory;
2  
3 # ABSTRACT: An in-memory collection (result of queries).
4  
5 2 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = "0.013_001";
9 2 $VERSION = eval $VERSION;
10  
11 2 extends 'Giddy::Collection';
12  
13 =head1 NAME
14  
15 Giddy::Collection::InMemory - An in-memory collection (result of queries).
16  
17 =head1 VERSION
18  
19 version 0.013_001
20  
21 =head1 SYNOPSIS
22  
23 my $in_memory_collection = $collection->find({ _name => qr/wow/ });
24  
25 # use $in_memory_collection just like any other Giddy::Collection object
26  
27 =head1 DESCRIPTION
28  
29 This class represents in-memory collections. These are created by running C<find()>
30 and C<grep()> queries on other collection (either real collections represented by
31 L<Giddy::Collection> or other in-memory collections).
32  
33 Except from not being able to drop in-memory collections, using them is performed
34 I<exactly> the same as using real ones, so refer to L<Giddy::Collection> for details.
35  
36 =head1 EXTENDS
37  
38 L<Giddy::Collection>
39  
40 =head1 ATTRIBUTES
41  
42 =head2 _documents
43  
44 An array-reference of the documents in the collection. Not to be used externally.
45  
46 =head2 _loaded
47  
48 A hash-ref containing loaded document structures. Not tobe used externally.
49  
50 =head2 _query
51  
52 A hash-ref with details about the query that created the collection.
53 Not to be used externally.
54  
55 =cut
56  
57 0 ▶has '_documents' => (is => 'ro', isa => 'Tie::IxHash', default => sub { Tie::IxHash->new }, writer => '_set_documents');
Subroutine __ANON__: not called CC=1 SCAR=1.2
58  
59 0 ▶has '_loaded' => (is => 'ro', isa => 'HashRef[HashRef]', default => sub { {} }, writer => '_set_loaded');
Subroutine __ANON__: not called CC=1 SCAR=1.2
60  
61 2 has '_query' => (is => 'ro', isa => 'HashRef', required => 1);
62  
63 =head1 METHODS
64  
65 Just the same as in L<Giddy::Collection>, of course, except for:
66  
67 =head2 drop()
68  
69 Doesn't do anything. Really.
70  
71 =cut
72  
73 0 ▶sub drop { 1 }
Subroutine drop: not called CC=1 SCAR=6.9
Pod documented
74  
75 =head1 AUTHOR
76  
77 Ido Perlmuter, C<< <ido at ido50.net> >>
78  
79 =head1 BUGS
80  
81 Please report any bugs or feature requests to C<bug-giddy at rt.cpan.org>, or through
82 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Giddy>. I will be notified, and then you'll
83 automatically be notified of progress on your bug as I make changes.
84  
85 =head1 SUPPORT
86  
87 You can find documentation for this module with the perldoc command.
88  
89 perldoc Giddy::Collection::InMemory
90  
91 You can also look for information at:
92  
93 =over 4
94  
95 =item * RT: CPAN's request tracker
96  
97 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Giddy>
98  
99 =item * AnnoCPAN: Annotated CPAN documentation
100  
101 L<http://annocpan.org/dist/Giddy>
102  
103 =item * CPAN Ratings
104  
105 L<http://cpanratings.perl.org/d/Giddy>
106  
107 =item * Search CPAN
108  
109 L<http://search.cpan.org/dist/Giddy/>
110  
111 =back
112  
113 =head1 LICENSE AND COPYRIGHT
114  
115 Copyright 2011 Ido Perlmuter.
116  
117 This program is free software; you can redistribute it and/or modify it
118 under the terms of either: the GNU General Public License as published
119 by the Free Software Foundation; or the Artistic License.
120  
121 See http://dev.perl.org/licenses/ for more information.
122  
123 =cut
124  
125 2 __PACKAGE__->meta->make_immutable;
« Giddy/Role/PathMaker.pm ↑ Summary