Nano/Types.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod n/a totaltotal 0.0% 0 / 38 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Nano::Types;
2  
3 use 5.014;
4  
5 use strict;
6 use warnings;
7  
8 use Data::Object::Types::Keywords;
9  
10 use base 'Data::Object::Types::Library';
11  
12 extends 'Types::Standard';
13  
14 our $VERSION = '0.06'; # VERSION
15  
16 register {
17 name => 'Env',
18 parent => 'Object',
19 validation => is_instance_of('Nano::Env'),
20 };
21  
22 register {
23 name => 'Nano',
24 parent => 'Object',
25 validation => is_instance_of('Nano'),
26 };
27  
28 register {
29 name => 'Node',
30 parent => 'Object',
31 validation => is_instance_of('Nano::Node'),
32 };
33  
34 register {
35 name => 'Nodes',
36 parent => 'Object',
37 validation => is_instance_of('Nano::Nodes'),
38 };
39  
40 register {
41 name => 'Search',
42 parent => 'Object',
43 validation => is_instance_of('Nano::Search'),
44 };
45  
46 register {
47 name => 'KeyVal',
48 parent => 'Object',
49 validation => is_instance_of('Zing::KeyVal'),
50 };
51  
52 register {
53 name => 'Stash',
54 parent => 'Object',
55 validation => is_consumer_of('Nano::Stash'),
56 };
57  
58 register {
59 name => 'Table',
60 parent => 'Object',
61 validation => is_instance_of('Zing::Table'),
62 };
63  
64 1;
65  
66 =encoding utf8
67  
68 =head1 NAME
69  
70 Nano::Types - Type Library
71  
72 =cut
73  
74 =head1 ABSTRACT
75  
76 Type Library
77  
78 =cut
79  
80 =head1 SYNOPSIS
81  
82 package main;
83  
84 use Nano::Types;
85  
86 1;
87  
88 =cut
89  
90 =head1 DESCRIPTION
91  
92 This package provides type constraints for the L<Nano> object persistence
93 framework.
94  
95 =cut
96  
97 =head1 LIBRARIES
98  
99 This package uses type constraints from:
100  
101 L<Types::Standard>
102  
103 =cut
104  
105 =head1 CONSTRAINTS
106  
107 This package declares the following type constraints:
108  
109 =cut
110  
111 =head2 env
112  
113 Env
114  
115 This type is defined in the L<Nano::Types> library.
116  
117 =over 4
118  
119 =item env parent
120  
121 Object
122  
123 =back
124  
125 =over 4
126  
127 =item env composition
128  
129 InstanceOf["Nano::Env"]
130  
131 =back
132  
133 =over 4
134  
135 =item env example #1
136  
137 # given: synopsis
138  
139 use Nano::Env;
140  
141 my $env = Nano::Env->new;
142  
143 =back
144  
145 =cut
146  
147 =head2 keyval
148  
149 KeyVal
150  
151 This type is defined in the L<Nano::Types> library.
152  
153 =over 4
154  
155 =item keyval parent
156  
157 Object
158  
159 =back
160  
161 =over 4
162  
163 =item keyval composition
164  
165 InstanceOf["Zing::KeyVal"]
166  
167 =back
168  
169 =over 4
170  
171 =item keyval example #1
172  
173 # given: synopsis
174  
175 use Zing::KeyVal;
176  
177 my $domain = Zing::KeyVal->new(name => 'user-12345');
178  
179 =back
180  
181 =cut
182  
183 =head2 nano
184  
185 Nano
186  
187 This type is defined in the L<Nano::Types> library.
188  
189 =over 4
190  
191 =item nano parent
192  
193 Object
194  
195 =back
196  
197 =over 4
198  
199 =item nano composition
200  
201 InstanceOf["Nano"]
202  
203 =back
204  
205 =over 4
206  
207 =item nano example #1
208  
209 # given: synopsis
210  
211 use Nano;
212  
213 my $nano = Nano->new;
214  
215 =back
216  
217 =cut
218  
219 =head2 node
220  
221 Node
222  
223 This type is defined in the L<Nano::Types> library.
224  
225 =over 4
226  
227 =item node parent
228  
229 Object
230  
231 =back
232  
233 =over 4
234  
235 =item node composition
236  
237 InstanceOf["Nano::Node"]
238  
239 =back
240  
241 =over 4
242  
243 =item node example #1
244  
245 # given: synopsis
246  
247 use Nano::Node;
248  
249 my $node = Nano::Node->new;
250  
251 =back
252  
253 =cut
254  
255 =head2 nodes
256  
257 Nodes
258  
259 This type is defined in the L<Nano::Types> library.
260  
261 =over 4
262  
263 =item nodes parent
264  
265 Object
266  
267 =back
268  
269 =over 4
270  
271 =item nodes composition
272  
273 InstanceOf["Nano::Nodes"]
274  
275 =back
276  
277 =over 4
278  
279 =item nodes example #1
280  
281 # given: synopsis
282  
283 use Nano::Nodes;
284  
285 my $nodes = Nano::Nodes->new;
286  
287 =back
288  
289 =cut
290  
291 =head2 search
292  
293 Search
294  
295 This type is defined in the L<Nano::Types> library.
296  
297 =over 4
298  
299 =item search parent
300  
301 Object
302  
303 =back
304  
305 =over 4
306  
307 =item search composition
308  
309 InstanceOf["Nano::Search"]
310  
311 =back
312  
313 =over 4
314  
315 =item search example #1
316  
317 # given: synopsis
318  
319 use Nano::Nodes;
320 use Nano::Search;
321  
322 my $search = Nano::Search->new(nodes => Nano::Nodes->new);
323  
324 =back
325  
326 =cut
327  
328 =head2 stash
329  
330 Stash
331  
332 This type is defined in the L<Nano::Types> library.
333  
334 =over 4
335  
336 =item stash parent
337  
338 Object
339  
340 =back
341  
342 =over 4
343  
344 =item stash composition
345  
346 ConsumerOf["Nano::Stash"]
347  
348 =back
349  
350 =over 4
351  
352 =item stash example #1
353  
354 # given: synopsis
355  
356 package Example::Stash;
357  
358 use Moo;
359  
360 extends 'Nano::Node';
361  
362 with 'Nano::Stash';
363  
364 package main;
365  
366 my $stash = Example::Stash->new;
367  
368 =back
369  
370 =cut
371  
372 =head2 table
373  
374 Table
375  
376 This type is defined in the L<Nano::Types> library.
377  
378 =over 4
379  
380 =item table parent
381  
382 Object
383  
384 =back
385  
386 =over 4
387  
388 =item table composition
389  
390 InstanceOf["Zing::Table"]
391  
392 =back
393  
394 =over 4
395  
396 =item table example #1
397  
398 # given: synopsis
399  
400 use Zing::Table;
401  
402 my $lookup = Zing::Table->new(name => 'users');
403  
404 =back
405  
406 =cut
407  
408 =head1 AUTHOR
409  
410 Al Newkirk, C<awncorp@cpan.org>
411  
412 =head1 LICENSE
413  
414 Copyright (C) 2011-2019, Al Newkirk, et al.
415  
416 This is free software; you can redistribute it and/or modify it under the terms
417 of the The Apache License, Version 2.0, as elucidated in the L<"license
418 file"|https://github.com/cpanery/nano/blob/master/LICENSE>.
419  
420 =head1 PROJECT
421  
422 L<Wiki|https://github.com/cpanery/nano/wiki>
423  
424 L<Project|https://github.com/cpanery/nano>
425  
426 L<Initiatives|https://github.com/cpanery/nano/projects>
427  
428 L<Milestones|https://github.com/cpanery/nano/milestones>
429  
430 L<Contributing|https://github.com/cpanery/nano/blob/master/CONTRIBUTE.md>
431  
432 L<Issues|https://github.com/cpanery/nano/issues>
433  
434 =cut