Zing/Data.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod n/a totaltotal 0.0% 0 / 32 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Zing::Data;
2  
3 use 5.014;
4  
5 use strict;
6 use warnings;
7  
8 use registry 'Zing::Types';
9 use routines;
10  
11 use Data::Object::Class;
12 use Data::Object::ClassHas;
13  
14 extends 'Zing::KeyVal';
15  
16 our $VERSION = '0.26'; # VERSION
17  
18 # METHODS
19  
20 method term() {
21 return $self->app->term($self)->data;
22 }
23  
24 1;
25  
26 =encoding utf8
27  
28 =head1 NAME
29  
30 Zing::Data - Process Data
31  
32 =cut
33  
34 =head1 ABSTRACT
35  
36 Process Key/Val Data Store
37  
38 =cut
39  
40 =head1 SYNOPSIS
41  
42 use Zing::Data;
43  
44 my $data = Zing::Data->new(name => rand);
45  
46 # $data->recv;
47  
48 =cut
49  
50 =head1 DESCRIPTION
51  
52 This package provides a process-specific key/value store for arbitrary data.
53  
54 =cut
55  
56 =head1 INHERITS
57  
58 This package inherits behaviors from:
59  
60 L<Zing::KeyVal>
61  
62 =cut
63  
64 =head1 LIBRARIES
65  
66 This package uses type constraints from:
67  
68 L<Zing::Types>
69  
70 =cut
71  
72 =head1 ATTRIBUTES
73  
74 This package has the following attributes:
75  
76 =cut
77  
78 =head2 name
79  
80 name(Str)
81  
82 This attribute is read-only, accepts C<(Str)> values, and is optional.
83  
84 =cut
85  
86 =head1 METHODS
87  
88 This package implements the following methods:
89  
90 =cut
91  
92 =head2 recv
93  
94 recv() : Maybe[HashRef]
95  
96 The recv method fetches the data (if any) from the store.
97  
98 =over 4
99  
100 =item recv example #1
101  
102 # given: synopsis
103  
104 $data->recv;
105  
106 =back
107  
108 =over 4
109  
110 =item recv example #2
111  
112 # given: synopsis
113  
114 $data->send({ status => 'works' });
115  
116 $data->recv;
117  
118 =back
119  
120 =cut
121  
122 =head2 send
123  
124 send(HashRef $value) : Str
125  
126 The send method commits data to the store overwriting any existing data.
127  
128 =over 4
129  
130 =item send example #1
131  
132 # given: synopsis
133  
134 $data->send({ status => 'works' });
135  
136 =back
137  
138 =over 4
139  
140 =item send example #2
141  
142 # given: synopsis
143  
144 $data->drop;
145  
146 $data->send({ status => 'works' });
147  
148 =back
149  
150 =cut
151  
152 =head1 AUTHOR
153  
154 Al Newkirk, C<awncorp@cpan.org>
155  
156 =head1 LICENSE
157  
158 Copyright (C) 2011-2019, Al Newkirk, et al.
159  
160 This is free software; you can redistribute it and/or modify it under the terms
161 of the The Apache License, Version 2.0, as elucidated in the L<"license
162 file"|https://github.com/iamalnewkirk/zing/blob/master/LICENSE>.
163  
164 =head1 PROJECT
165  
166 L<Wiki|https://github.com/iamalnewkirk/zing/wiki>
167  
168 L<Project|https://github.com/iamalnewkirk/zing>
169  
170 L<Initiatives|https://github.com/iamalnewkirk/zing/projects>
171  
172 L<Milestones|https://github.com/iamalnewkirk/zing/milestones>
173  
174 L<Contributing|https://github.com/iamalnewkirk/zing/blob/master/CONTRIBUTE.md>
175  
176 L<Issues|https://github.com/iamalnewkirk/zing/issues>
177  
178 =cut