chainpoint 0.0.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +12 -0
- data/.travis.yml +4 -1
- data/Gemfile +11 -3
- data/Gemfile.lock +47 -1
- data/README.md +65 -53
- data/Rakefile +7 -3
- data/bin/console +4 -3
- data/chainpoint.gemspec +17 -15
- data/docs/Chainpoint/Hash.html +636 -0
- data/docs/Chainpoint/Proof.html +567 -0
- data/docs/Chainpoint/ProofHandle.html +475 -0
- data/docs/Chainpoint.html +50 -838
- data/docs/_index.html +39 -2
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +70 -57
- data/docs/index.html +70 -57
- data/docs/method_list.html +97 -17
- data/docs/top-level-namespace.html +3 -3
- data/lib/chainpoint/hash.rb +62 -0
- data/lib/chainpoint/proof.rb +37 -0
- data/lib/chainpoint/proof_handle.rb +33 -0
- data/lib/chainpoint/version.rb +18 -18
- data/lib/chainpoint.rb +35 -130
- metadata +22 -1
@@ -0,0 +1,636 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Chainpoint::Hash
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.18
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "Chainpoint::Hash";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (H)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Chainpoint.html" title="Chainpoint (module)">Chainpoint</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Hash</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Chainpoint::Hash
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Chainpoint::Hash</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/chainpoint/hash.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<h2>
|
105
|
+
Constant Summary
|
106
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
107
|
+
</h2>
|
108
|
+
|
109
|
+
<dl class="constants">
|
110
|
+
|
111
|
+
<dt id="NUM_SERVERS-constant" class="">NUM_SERVERS =
|
112
|
+
|
113
|
+
</dt>
|
114
|
+
<dd><pre class="code"><span class='int'>3</span></pre></dd>
|
115
|
+
|
116
|
+
</dl>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
123
|
+
<ul class="summary">
|
124
|
+
|
125
|
+
<li class="public ">
|
126
|
+
<span class="summary_signature">
|
127
|
+
|
128
|
+
<a href="#hash-instance_method" title="#hash (instance method)">#<strong>hash</strong> ⇒ Object </a>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
</span>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
<span class="note title readonly">readonly</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<span class="summary_desc"><div class='inline'>
|
148
|
+
<p>Returns the value of attribute hash.</p>
|
149
|
+
</div></span>
|
150
|
+
|
151
|
+
</li>
|
152
|
+
|
153
|
+
|
154
|
+
<li class="public ">
|
155
|
+
<span class="summary_signature">
|
156
|
+
|
157
|
+
<a href="#proof_handles-instance_method" title="#proof_handles (instance method)">#<strong>proof_handles</strong> ⇒ Object </a>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<span class="note title readonly">readonly</span>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<span class="summary_desc"><div class='inline'>
|
177
|
+
<p>Returns the value of attribute proof_handles.</p>
|
178
|
+
</div></span>
|
179
|
+
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
183
|
+
</ul>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<h2>
|
190
|
+
Class Method Summary
|
191
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
192
|
+
</h2>
|
193
|
+
|
194
|
+
<ul class="summary">
|
195
|
+
|
196
|
+
<li class="public ">
|
197
|
+
<span class="summary_signature">
|
198
|
+
|
199
|
+
<a href="#from_data-class_method" title="from_data (class method)">.<strong>from_data</strong>(data) ⇒ Object </a>
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
</span>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
|
218
|
+
</ul>
|
219
|
+
|
220
|
+
<h2>
|
221
|
+
Instance Method Summary
|
222
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
223
|
+
</h2>
|
224
|
+
|
225
|
+
<ul class="summary">
|
226
|
+
|
227
|
+
<li class="public ">
|
228
|
+
<span class="summary_signature">
|
229
|
+
|
230
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(hash, proof_handles: []) ⇒ Hash </a>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
</span>
|
235
|
+
|
236
|
+
|
237
|
+
<span class="note title constructor">constructor</span>
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
<span class="summary_desc"><div class='inline'>
|
247
|
+
<p>A new instance of Hash.</p>
|
248
|
+
</div></span>
|
249
|
+
|
250
|
+
</li>
|
251
|
+
|
252
|
+
|
253
|
+
<li class="public ">
|
254
|
+
<span class="summary_signature">
|
255
|
+
|
256
|
+
<a href="#proof-instance_method" title="#proof (instance method)">#<strong>proof</strong>(anchor_type = nil) ⇒ Object </a>
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
</span>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
271
|
+
|
272
|
+
</li>
|
273
|
+
|
274
|
+
|
275
|
+
<li class="public ">
|
276
|
+
<span class="summary_signature">
|
277
|
+
|
278
|
+
<a href="#submit-instance_method" title="#submit (instance method)">#<strong>submit</strong> ⇒ Object </a>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
</span>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
293
|
+
|
294
|
+
</li>
|
295
|
+
|
296
|
+
|
297
|
+
<li class="public ">
|
298
|
+
<span class="summary_signature">
|
299
|
+
|
300
|
+
<a href="#to_h-instance_method" title="#to_h (instance method)">#<strong>to_h</strong> ⇒ Object </a>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
</span>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
315
|
+
|
316
|
+
</li>
|
317
|
+
|
318
|
+
|
319
|
+
</ul>
|
320
|
+
|
321
|
+
|
322
|
+
<div id="constructor_details" class="method_details_list">
|
323
|
+
<h2>Constructor Details</h2>
|
324
|
+
|
325
|
+
<div class="method_details first">
|
326
|
+
<h3 class="signature first" id="initialize-instance_method">
|
327
|
+
|
328
|
+
#<strong>initialize</strong>(hash, proof_handles: []) ⇒ <tt><span class='object_link'><a href="" title="Chainpoint::Hash (class)">Hash</a></span></tt>
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
</h3><div class="docstring">
|
335
|
+
<div class="discussion">
|
336
|
+
|
337
|
+
<p>Returns a new instance of Hash</p>
|
338
|
+
|
339
|
+
|
340
|
+
</div>
|
341
|
+
</div>
|
342
|
+
<div class="tags">
|
343
|
+
|
344
|
+
|
345
|
+
</div><table class="source_code">
|
346
|
+
<tr>
|
347
|
+
<td>
|
348
|
+
<pre class="lines">
|
349
|
+
|
350
|
+
|
351
|
+
15
|
352
|
+
16
|
353
|
+
17
|
354
|
+
18
|
355
|
+
19
|
356
|
+
20
|
357
|
+
21</pre>
|
358
|
+
</td>
|
359
|
+
<td>
|
360
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 15</span>
|
361
|
+
|
362
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='label'>proof_handles:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
363
|
+
<span class='ivar'>@hash</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span>
|
364
|
+
<span class='ivar'>@proof_handles</span> <span class='op'>=</span>
|
365
|
+
<span class='id identifier rubyid_proof_handles'>proof_handles</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
|
366
|
+
<span class='const'><span class='object_link'><a href="ProofHandle.html" title="Chainpoint::ProofHandle (class)">ProofHandle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ProofHandle.html#initialize-instance_method" title="Chainpoint::ProofHandle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:uri</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:node_hash_id</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
367
|
+
<span class='kw'>end</span>
|
368
|
+
<span class='kw'>end</span></pre>
|
369
|
+
</td>
|
370
|
+
</tr>
|
371
|
+
</table>
|
372
|
+
</div>
|
373
|
+
|
374
|
+
</div>
|
375
|
+
|
376
|
+
<div id="instance_attr_details" class="attr_details">
|
377
|
+
<h2>Instance Attribute Details</h2>
|
378
|
+
|
379
|
+
|
380
|
+
<span id=""></span>
|
381
|
+
<div class="method_details first">
|
382
|
+
<h3 class="signature first" id="hash-instance_method">
|
383
|
+
|
384
|
+
#<strong>hash</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
</h3><div class="docstring">
|
391
|
+
<div class="discussion">
|
392
|
+
|
393
|
+
<p>Returns the value of attribute hash</p>
|
394
|
+
|
395
|
+
|
396
|
+
</div>
|
397
|
+
</div>
|
398
|
+
<div class="tags">
|
399
|
+
|
400
|
+
|
401
|
+
</div><table class="source_code">
|
402
|
+
<tr>
|
403
|
+
<td>
|
404
|
+
<pre class="lines">
|
405
|
+
|
406
|
+
|
407
|
+
9
|
408
|
+
10
|
409
|
+
11</pre>
|
410
|
+
</td>
|
411
|
+
<td>
|
412
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 9</span>
|
413
|
+
|
414
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span>
|
415
|
+
<span class='ivar'>@hash</span>
|
416
|
+
<span class='kw'>end</span></pre>
|
417
|
+
</td>
|
418
|
+
</tr>
|
419
|
+
</table>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
|
423
|
+
<span id=""></span>
|
424
|
+
<div class="method_details ">
|
425
|
+
<h3 class="signature " id="proof_handles-instance_method">
|
426
|
+
|
427
|
+
#<strong>proof_handles</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
</h3><div class="docstring">
|
434
|
+
<div class="discussion">
|
435
|
+
|
436
|
+
<p>Returns the value of attribute proof_handles</p>
|
437
|
+
|
438
|
+
|
439
|
+
</div>
|
440
|
+
</div>
|
441
|
+
<div class="tags">
|
442
|
+
|
443
|
+
|
444
|
+
</div><table class="source_code">
|
445
|
+
<tr>
|
446
|
+
<td>
|
447
|
+
<pre class="lines">
|
448
|
+
|
449
|
+
|
450
|
+
9
|
451
|
+
10
|
452
|
+
11</pre>
|
453
|
+
</td>
|
454
|
+
<td>
|
455
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 9</span>
|
456
|
+
|
457
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_proof_handles'>proof_handles</span>
|
458
|
+
<span class='ivar'>@proof_handles</span>
|
459
|
+
<span class='kw'>end</span></pre>
|
460
|
+
</td>
|
461
|
+
</tr>
|
462
|
+
</table>
|
463
|
+
</div>
|
464
|
+
|
465
|
+
</div>
|
466
|
+
|
467
|
+
|
468
|
+
<div id="class_method_details" class="method_details_list">
|
469
|
+
<h2>Class Method Details</h2>
|
470
|
+
|
471
|
+
|
472
|
+
<div class="method_details first">
|
473
|
+
<h3 class="signature first" id="from_data-class_method">
|
474
|
+
|
475
|
+
.<strong>from_data</strong>(data) ⇒ <tt>Object</tt>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
</h3><table class="source_code">
|
482
|
+
<tr>
|
483
|
+
<td>
|
484
|
+
<pre class="lines">
|
485
|
+
|
486
|
+
|
487
|
+
11
|
488
|
+
12
|
489
|
+
13</pre>
|
490
|
+
</td>
|
491
|
+
<td>
|
492
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 11</span>
|
493
|
+
|
494
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_data'>from_data</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
495
|
+
<span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Digest</span><span class='op'>::</span><span class='const'>SHA256</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
496
|
+
<span class='kw'>end</span></pre>
|
497
|
+
</td>
|
498
|
+
</tr>
|
499
|
+
</table>
|
500
|
+
</div>
|
501
|
+
|
502
|
+
</div>
|
503
|
+
|
504
|
+
<div id="instance_method_details" class="method_details_list">
|
505
|
+
<h2>Instance Method Details</h2>
|
506
|
+
|
507
|
+
|
508
|
+
<div class="method_details first">
|
509
|
+
<h3 class="signature first" id="proof-instance_method">
|
510
|
+
|
511
|
+
#<strong>proof</strong>(anchor_type = nil) ⇒ <tt>Object</tt>
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
</h3><table class="source_code">
|
518
|
+
<tr>
|
519
|
+
<td>
|
520
|
+
<pre class="lines">
|
521
|
+
|
522
|
+
|
523
|
+
33
|
524
|
+
34
|
525
|
+
35
|
526
|
+
36
|
527
|
+
37
|
528
|
+
38
|
529
|
+
39</pre>
|
530
|
+
</td>
|
531
|
+
<td>
|
532
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 33</span>
|
533
|
+
|
534
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_proof'>proof</span><span class='lparen'>(</span><span class='id identifier rubyid_anchor_type'>anchor_type</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
535
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='ivar'>@proof_handles</span><span class='period'>.</span><span class='id identifier rubyid_any?'>any?</span>
|
536
|
+
|
537
|
+
<span class='id identifier rubyid_proofs'>proofs</span> <span class='op'>=</span> <span class='ivar'>@proof_handles</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:proof</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
538
|
+
|
539
|
+
<span class='id identifier rubyid_anchor_type'>anchor_type</span> <span class='op'>?</span> <span class='id identifier rubyid_proofs'>proofs</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_anchors_complete'>anchors_complete</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_anchor_type'>anchor_type</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='op'>:</span> <span class='id identifier rubyid_proofs'>proofs</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
|
540
|
+
<span class='kw'>end</span></pre>
|
541
|
+
</td>
|
542
|
+
</tr>
|
543
|
+
</table>
|
544
|
+
</div>
|
545
|
+
|
546
|
+
<div class="method_details ">
|
547
|
+
<h3 class="signature " id="submit-instance_method">
|
548
|
+
|
549
|
+
#<strong>submit</strong> ⇒ <tt>Object</tt>
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
</h3><table class="source_code">
|
556
|
+
<tr>
|
557
|
+
<td>
|
558
|
+
<pre class="lines">
|
559
|
+
|
560
|
+
|
561
|
+
23
|
562
|
+
24
|
563
|
+
25
|
564
|
+
26
|
565
|
+
27
|
566
|
+
28
|
567
|
+
29
|
568
|
+
30
|
569
|
+
31</pre>
|
570
|
+
</td>
|
571
|
+
<td>
|
572
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 23</span>
|
573
|
+
|
574
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_submit'>submit</span>
|
575
|
+
<span class='ivar'>@proof_handles</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Chainpoint.html" title="Chainpoint (module)">Chainpoint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_select_nodes'><span class='object_link'><a href="../Chainpoint.html#select_nodes-class_method" title="Chainpoint.select_nodes (method)">select_nodes</a></span></span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#NUM_SERVERS-constant" title="Chainpoint::Hash::NUM_SERVERS (constant)">NUM_SERVERS</a></span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_uri'>uri</span><span class='op'>|</span>
|
576
|
+
<span class='id identifier rubyid_post_hash'>post_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_uri'>uri</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hashes</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>|</span>
|
577
|
+
<span class='const'><span class='object_link'><a href="../Chainpoint.html" title="Chainpoint (module)">Chainpoint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ProofHandle.html" title="Chainpoint::ProofHandle (class)">ProofHandle</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ProofHandle.html#initialize-instance_method" title="Chainpoint::ProofHandle#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_uri'>uri</span><span class='comma'>,</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>hash_id_node</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
578
|
+
<span class='kw'>end</span>
|
579
|
+
<span class='kw'>end</span>
|
580
|
+
|
581
|
+
<span class='ivar'>@proof_handles</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_h</span><span class='rparen'>)</span>
|
582
|
+
<span class='kw'>end</span></pre>
|
583
|
+
</td>
|
584
|
+
</tr>
|
585
|
+
</table>
|
586
|
+
</div>
|
587
|
+
|
588
|
+
<div class="method_details ">
|
589
|
+
<h3 class="signature " id="to_h-instance_method">
|
590
|
+
|
591
|
+
#<strong>to_h</strong> ⇒ <tt>Object</tt>
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
</h3><table class="source_code">
|
598
|
+
<tr>
|
599
|
+
<td>
|
600
|
+
<pre class="lines">
|
601
|
+
|
602
|
+
|
603
|
+
41
|
604
|
+
42
|
605
|
+
43
|
606
|
+
44
|
607
|
+
45
|
608
|
+
46</pre>
|
609
|
+
</td>
|
610
|
+
<td>
|
611
|
+
<pre class="code"><span class="info file"># File 'lib/chainpoint/hash.rb', line 41</span>
|
612
|
+
|
613
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
|
614
|
+
<span class='lbrace'>{</span>
|
615
|
+
<span class='label'>hash:</span> <span class='ivar'>@hash</span><span class='comma'>,</span>
|
616
|
+
<span class='label'>proof_handles:</span> <span class='ivar'>@proof_handles</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_h</span><span class='rparen'>)</span>
|
617
|
+
<span class='rbrace'>}</span>
|
618
|
+
<span class='kw'>end</span></pre>
|
619
|
+
</td>
|
620
|
+
</tr>
|
621
|
+
</table>
|
622
|
+
</div>
|
623
|
+
|
624
|
+
</div>
|
625
|
+
|
626
|
+
</div>
|
627
|
+
|
628
|
+
<div id="footer">
|
629
|
+
Generated on Sun Mar 31 14:30:37 2019 by
|
630
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
631
|
+
0.9.18 (ruby-2.5.1).
|
632
|
+
</div>
|
633
|
+
|
634
|
+
</div>
|
635
|
+
</body>
|
636
|
+
</html>
|