Zing/Meta.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::Meta;
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)->meta;
22 }
23  
24 1;
25  
26 =encoding utf8
27  
28 =head1 NAME
29  
30 Zing::Meta - Process Metadata
31  
32 =cut
33  
34 =head1 ABSTRACT
35  
36 Generic Process Metadata
37  
38 =cut
39  
40 =head1 SYNOPSIS
41  
42 use Zing::Meta;
43  
44 my $meta = Zing::Meta->new(name => rand);
45  
46 # $meta->recv;
47  
48 =cut
49  
50 =head1 DESCRIPTION
51  
52 This package provides process metadata for tracking active processes.
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 drop
93  
94 drop() : Int
95  
96 The drop method returns truthy if the process metadata can be dropped.
97  
98 =over 4
99  
100 =item drop example #1
101  
102 # given: synopsis
103  
104 $meta->drop;
105  
106 =back
107  
108 =cut
109  
110 =head2 recv
111  
112 recv() : Maybe[HashRef]
113  
114 The recv method fetches the process metadata (if any).
115  
116 =over 4
117  
118 =item recv example #1
119  
120 # given: synopsis
121  
122 $meta->recv;
123  
124 =back
125  
126 =over 4
127  
128 =item recv example #2
129  
130 # given: synopsis
131  
132 use Zing::Process;
133  
134 $meta->send(Zing::Process->new->metadata);
135  
136 $meta->recv;
137  
138 =back
139  
140 =cut
141  
142 =head2 send
143  
144 send(HashRef $proc) : Str
145  
146 The send method commits the metadata provided to the store overwriting any
147 existing data.
148  
149 =over 4
150  
151 =item send example #1
152  
153 # given: synopsis
154  
155 $meta->send({ created => time });
156  
157 =back
158  
159 =over 4
160  
161 =item send example #2
162  
163 # given: synopsis
164  
165 use Zing::Process;
166  
167 $meta->drop;
168  
169 $meta->send(Zing::Process->new->metadata);
170  
171 =back
172  
173 =cut
174  
175 =head2 term
176  
177 term(Str @keys) : Str
178  
179 The term method generates a term (safe string) for the metadata.
180  
181 =over 4
182  
183 =item term example #1
184  
185 # given: synopsis
186  
187 $meta->term;
188  
189 =back
190  
191 =cut
192  
193 =head1 AUTHOR
194  
195 Al Newkirk, C<awncorp@cpan.org>
196  
197 =head1 LICENSE
198  
199 Copyright (C) 2011-2019, Al Newkirk, et al.
200  
201 This is free software; you can redistribute it and/or modify it under the terms
202 of the The Apache License, Version 2.0, as elucidated in the L<"license
203 file"|https://github.com/iamalnewkirk/zing/blob/master/LICENSE>.
204  
205 =head1 PROJECT
206  
207 L<Wiki|https://github.com/iamalnewkirk/zing/wiki>
208  
209 L<Project|https://github.com/iamalnewkirk/zing>
210  
211 L<Initiatives|https://github.com/iamalnewkirk/zing/projects>
212  
213 L<Milestones|https://github.com/iamalnewkirk/zing/milestones>
214  
215 L<Contributing|https://github.com/iamalnewkirk/zing/blob/master/CONTRIBUTE.md>
216  
217 L<Issues|https://github.com/iamalnewkirk/zing/issues>
218  
219 =cut