keoken 0.2.1 → 0.2.2
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/.yardoc/checksums +8 -4
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile.lock +1 -1
- data/doc/Bitcoin/Script.html +1 -1
- data/doc/Keoken/Backend/Base.html +347 -0
- data/doc/Keoken/Backend/BitcoinRuby/Transaction.html +106 -192
- data/doc/Keoken/Backend/BitcoinRuby.html +1 -1
- data/doc/Keoken/Backend/Trezor/Transaction.html +512 -0
- data/doc/Keoken/Backend/Trezor.html +115 -0
- data/doc/Keoken/Backend.html +7 -3
- data/doc/Keoken/Bitprim/Transaction.html +1 -1
- data/doc/Keoken/Bitprim.html +1 -1
- data/doc/Keoken/DataNotParsed.html +202 -0
- data/doc/Keoken/IdNotFound.html +1 -1
- data/doc/Keoken/NameNotFound.html +1 -1
- data/doc/Keoken/OutputNotFound.html +1 -1
- data/doc/Keoken/Parser.html +479 -0
- data/doc/Keoken/Token.html +289 -108
- data/doc/Keoken.html +11 -11
- data/doc/_index.html +55 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +13 -13
- data/doc/index.html +13 -13
- data/doc/method_list.html +120 -16
- data/doc/top-level-namespace.html +1 -1
- data/lib/keoken/backend/trezor/transaction.rb +2 -2
- data/lib/keoken/errors/data_not_parsed.rb +5 -3
- data/lib/keoken/errors/id_not_found.rb +5 -3
- data/lib/keoken/errors/name_not_found.rb +5 -3
- data/lib/keoken/errors/output_not_found.rb +5 -3
- data/lib/keoken/parser.rb +6 -6
- data/lib/keoken/token.rb +2 -2
- data/lib/keoken/version.rb +1 -1
- data/lib/keoken.rb +5 -3
- data/spec/keoken_spec.rb +111 -45
- metadata +6 -1
data/doc/Keoken/Token.html
CHANGED
@@ -69,11 +69,13 @@
|
|
69
69
|
<dl>
|
70
70
|
<dt>Inherits:</dt>
|
71
71
|
<dd>
|
72
|
-
<span class="inheritName">
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Parser.html" title="Keoken::Parser (class)">Parser</a></span></span>
|
73
73
|
|
74
74
|
<ul class="fullTree">
|
75
75
|
<li>Object</li>
|
76
76
|
|
77
|
+
<li class="next"><span class='object_link'><a href="Parser.html" title="Keoken::Parser (class)">Parser</a></span></li>
|
78
|
+
|
77
79
|
<li class="next">Keoken::Token</li>
|
78
80
|
|
79
81
|
</ul>
|
@@ -109,7 +111,7 @@
|
|
109
111
|
<li class="public ">
|
110
112
|
<span class="summary_signature">
|
111
113
|
|
112
|
-
<a href="#
|
114
|
+
<a href="#data_script-instance_method" title="#data_script (instance method)">#<strong>data_script</strong> ⇒ Object </a>
|
113
115
|
|
114
116
|
|
115
117
|
|
@@ -126,7 +128,7 @@
|
|
126
128
|
|
127
129
|
|
128
130
|
|
129
|
-
<span class="summary_desc"><div class='inline'>Returns the value of attribute
|
131
|
+
<span class="summary_desc"><div class='inline'>Returns the value of attribute data_script.</div></span>
|
130
132
|
|
131
133
|
</li>
|
132
134
|
|
@@ -156,10 +158,28 @@
|
|
156
158
|
</li>
|
157
159
|
|
158
160
|
|
159
|
-
|
161
|
+
</ul>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Parser.html" title="Keoken::Parser (class)">Parser</a></span></h3>
|
168
|
+
<p class="inherited"><span class='object_link'><a href="Parser.html#amount-instance_method" title="Keoken::Parser#amount (method)">#amount</a></span>, <span class='object_link'><a href="Parser.html#data-instance_method" title="Keoken::Parser#data (method)">#data</a></span>, <span class='object_link'><a href="Parser.html#name-instance_method" title="Keoken::Parser#name (method)">#name</a></span>, <span class='object_link'><a href="Parser.html#transaction_type-instance_method" title="Keoken::Parser#transaction_type (method)">#transaction_type</a></span></p>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
<h2>
|
173
|
+
Instance Method Summary
|
174
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
175
|
+
</h2>
|
176
|
+
|
177
|
+
<ul class="summary">
|
178
|
+
|
179
|
+
<li class="public ">
|
160
180
|
<span class="summary_signature">
|
161
181
|
|
162
|
-
<a href="#
|
182
|
+
<a href="#create-instance_method" title="#create (instance method)">#<strong>create</strong>(amount) ⇒ Keoken::Token </a>
|
163
183
|
|
164
184
|
|
165
185
|
|
@@ -167,8 +187,27 @@
|
|
167
187
|
|
168
188
|
|
169
189
|
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
<span class="summary_desc"><div class='inline'>Generate the script to create a token.</div></span>
|
197
|
+
|
198
|
+
</li>
|
199
|
+
|
200
|
+
|
201
|
+
<li class="public ">
|
202
|
+
<span class="summary_signature">
|
203
|
+
|
204
|
+
<a href="#hex-instance_method" title="#hex (instance method)">#<strong>hex</strong> ⇒ String </a>
|
170
205
|
|
206
|
+
|
171
207
|
|
208
|
+
</span>
|
209
|
+
|
210
|
+
|
172
211
|
|
173
212
|
|
174
213
|
|
@@ -176,28 +215,39 @@
|
|
176
215
|
|
177
216
|
|
178
217
|
|
179
|
-
<span class="summary_desc"><div class='inline'>
|
218
|
+
<span class="summary_desc"><div class='inline'>Hexadecimal value of script.</div></span>
|
180
219
|
|
181
220
|
</li>
|
182
221
|
|
222
|
+
|
223
|
+
<li class="public ">
|
224
|
+
<span class="summary_signature">
|
225
|
+
|
226
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(options = {}) ⇒ Token </a>
|
183
227
|
|
184
|
-
</ul>
|
185
|
-
|
186
|
-
|
187
228
|
|
229
|
+
|
230
|
+
</span>
|
231
|
+
|
232
|
+
|
233
|
+
<span class="note title constructor">constructor</span>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
188
240
|
|
189
241
|
|
190
|
-
<
|
191
|
-
|
192
|
-
|
193
|
-
</h2>
|
242
|
+
<span class="summary_desc"><div class='inline'>Creates a new token object.</div></span>
|
243
|
+
|
244
|
+
</li>
|
194
245
|
|
195
|
-
<ul class="summary">
|
196
246
|
|
197
247
|
<li class="public ">
|
198
248
|
<span class="summary_signature">
|
199
249
|
|
200
|
-
<a href="#
|
250
|
+
<a href="#send_amount-instance_method" title="#send_amount (instance method)">#<strong>send_amount</strong>(amount) ⇒ Keoken::Token </a>
|
201
251
|
|
202
252
|
|
203
253
|
|
@@ -211,7 +261,7 @@
|
|
211
261
|
|
212
262
|
|
213
263
|
|
214
|
-
<span class="summary_desc"><div class='inline'>Generate the script to
|
264
|
+
<span class="summary_desc"><div class='inline'>Generate the script to send an amount from one address to another.</div></span>
|
215
265
|
|
216
266
|
</li>
|
217
267
|
|
@@ -219,15 +269,13 @@
|
|
219
269
|
<li class="public ">
|
220
270
|
<span class="summary_signature">
|
221
271
|
|
222
|
-
<a href="#
|
272
|
+
<a href="#to_hash-instance_method" title="#to_hash (instance method)">#<strong>to_hash</strong> ⇒ Object </a>
|
223
273
|
|
224
274
|
|
225
275
|
|
226
276
|
</span>
|
227
277
|
|
228
278
|
|
229
|
-
<span class="note title constructor">constructor</span>
|
230
|
-
|
231
279
|
|
232
280
|
|
233
281
|
|
@@ -235,7 +283,7 @@
|
|
235
283
|
|
236
284
|
|
237
285
|
|
238
|
-
<span class="summary_desc"><div class='inline'>
|
286
|
+
<span class="summary_desc"><div class='inline'>Deserialization of object.</div></span>
|
239
287
|
|
240
288
|
</li>
|
241
289
|
|
@@ -243,7 +291,7 @@
|
|
243
291
|
<li class="public ">
|
244
292
|
<span class="summary_signature">
|
245
293
|
|
246
|
-
<a href="#
|
294
|
+
<a href="#to_json-instance_method" title="#to_json (instance method)">#<strong>to_json</strong> ⇒ Object </a>
|
247
295
|
|
248
296
|
|
249
297
|
|
@@ -257,7 +305,7 @@
|
|
257
305
|
|
258
306
|
|
259
307
|
|
260
|
-
<span class="summary_desc"><div class='inline'>
|
308
|
+
<span class="summary_desc"><div class='inline'>JSON serialization of object.</div></span>
|
261
309
|
|
262
310
|
</li>
|
263
311
|
|
@@ -265,7 +313,13 @@
|
|
265
313
|
</ul>
|
266
314
|
|
267
315
|
|
268
|
-
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
<div id="constructor_details" class="method_details_list">
|
269
323
|
<h2>Constructor Details</h2>
|
270
324
|
|
271
325
|
<div class="method_details first">
|
@@ -333,6 +387,17 @@
|
|
333
387
|
|
334
388
|
</li>
|
335
389
|
|
390
|
+
<li>
|
391
|
+
<span class="name">:script</span>
|
392
|
+
<span class="type">(<tt>String</tt>)</span>
|
393
|
+
<span class="default">
|
394
|
+
|
395
|
+
</span>
|
396
|
+
|
397
|
+
— <div class='inline'>An hexadecimal script intended to be parsed.</div>
|
398
|
+
|
399
|
+
</li>
|
400
|
+
|
336
401
|
</ul>
|
337
402
|
|
338
403
|
|
@@ -343,17 +408,23 @@
|
|
343
408
|
<pre class="lines">
|
344
409
|
|
345
410
|
|
346
|
-
11
|
347
411
|
12
|
348
412
|
13
|
349
|
-
14
|
413
|
+
14
|
414
|
+
15
|
415
|
+
16
|
416
|
+
17
|
417
|
+
18</pre>
|
350
418
|
</td>
|
351
419
|
<td>
|
352
|
-
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line
|
420
|
+
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 12</span>
|
353
421
|
|
354
422
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
355
|
-
<span class='ivar'>@name</span>
|
356
|
-
<span class='ivar'>@id</span>
|
423
|
+
<span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span>
|
424
|
+
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:id</span><span class='rbracket'>]</span>
|
425
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:script</span><span class='rbracket'>]</span>
|
426
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:script</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
427
|
+
<span class='id identifier rubyid_parse_script'>parse_script</span>
|
357
428
|
<span class='kw'>end</span></pre>
|
358
429
|
</td>
|
359
430
|
</tr>
|
@@ -366,11 +437,11 @@
|
|
366
437
|
<h2>Instance Attribute Details</h2>
|
367
438
|
|
368
439
|
|
369
|
-
<span id="
|
440
|
+
<span id="data_script=-instance_method"></span>
|
370
441
|
<div class="method_details first">
|
371
|
-
<h3 class="signature first" id="
|
442
|
+
<h3 class="signature first" id="data_script-instance_method">
|
372
443
|
|
373
|
-
#<strong>
|
444
|
+
#<strong>data_script</strong> ⇒ <tt>Object</tt>
|
374
445
|
|
375
446
|
|
376
447
|
|
@@ -378,7 +449,7 @@
|
|
378
449
|
|
379
450
|
</h3><div class="docstring">
|
380
451
|
<div class="discussion">
|
381
|
-
Returns the value of attribute
|
452
|
+
Returns the value of attribute data_script
|
382
453
|
|
383
454
|
</div>
|
384
455
|
</div>
|
@@ -398,8 +469,8 @@
|
|
398
469
|
<td>
|
399
470
|
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 3</span>
|
400
471
|
|
401
|
-
<span class='kw'>def</span> <span class='id identifier
|
402
|
-
<span class='ivar'>@
|
472
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_data_script'>data_script</span>
|
473
|
+
<span class='ivar'>@data_script</span>
|
403
474
|
<span class='kw'>end</span></pre>
|
404
475
|
</td>
|
405
476
|
</tr>
|
@@ -447,47 +518,6 @@
|
|
447
518
|
</table>
|
448
519
|
</div>
|
449
520
|
|
450
|
-
|
451
|
-
<span id="name=-instance_method"></span>
|
452
|
-
<div class="method_details ">
|
453
|
-
<h3 class="signature " id="name-instance_method">
|
454
|
-
|
455
|
-
#<strong>name</strong> ⇒ <tt>Object</tt>
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
</h3><div class="docstring">
|
462
|
-
<div class="discussion">
|
463
|
-
Returns the value of attribute name
|
464
|
-
|
465
|
-
</div>
|
466
|
-
</div>
|
467
|
-
<div class="tags">
|
468
|
-
|
469
|
-
|
470
|
-
</div><table class="source_code">
|
471
|
-
<tr>
|
472
|
-
<td>
|
473
|
-
<pre class="lines">
|
474
|
-
|
475
|
-
|
476
|
-
3
|
477
|
-
4
|
478
|
-
5</pre>
|
479
|
-
</td>
|
480
|
-
<td>
|
481
|
-
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 3</span>
|
482
|
-
|
483
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
484
|
-
<span class='ivar'>@name</span>
|
485
|
-
<span class='kw'>end</span></pre>
|
486
|
-
</td>
|
487
|
-
</tr>
|
488
|
-
</table>
|
489
|
-
</div>
|
490
|
-
|
491
521
|
</div>
|
492
522
|
|
493
523
|
|
@@ -566,10 +596,6 @@
|
|
566
596
|
<pre class="lines">
|
567
597
|
|
568
598
|
|
569
|
-
22
|
570
|
-
23
|
571
|
-
24
|
572
|
-
25
|
573
599
|
26
|
574
600
|
27
|
575
601
|
28
|
@@ -583,26 +609,87 @@
|
|
583
609
|
36</pre>
|
584
610
|
</td>
|
585
611
|
<td>
|
586
|
-
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line
|
612
|
+
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 26</span>
|
587
613
|
|
588
614
|
<span class='kw'>def</span> <span class='id identifier rubyid_create'>create</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='rparen'>)</span>
|
589
615
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="NameNotFound.html" title="Keoken::NameNotFound (class)">NameNotFound</a></span></span> <span class='kw'>unless</span> <span class='ivar'>@name</span>
|
590
|
-
<span class='
|
591
|
-
<span class='lbracket'>[</span
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
<span class='ivar'>@hex</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='const'>Bitcoin</span><span class='op'>::</span><span class='const'>Script</span><span class='op'>::</span><span class='const'>OP_RETURN</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='comma'>,</span>
|
598
|
-
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX_SIZE-constant" title="Keoken::PREFIX_SIZE (constant)">PREFIX_SIZE</a></span></span><span class='comma'>,</span>
|
599
|
-
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX-constant" title="Keoken::PREFIX (constant)">PREFIX</a></span></span><span class='comma'>,</span>
|
600
|
-
<span class='id identifier rubyid_data_length'>data_length</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='op'>+</span> <span class='id identifier rubyid_data_script'>data_script</span>
|
616
|
+
<span class='ivar'>@data_script</span> <span class='op'>=</span>
|
617
|
+
<span class='lbracket'>[</span>
|
618
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#VERSION_NODE-constant" title="Keoken::VERSION_NODE (constant)">VERSION_NODE</a></span></span><span class='comma'>,</span>
|
619
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#TYPE_CREATE_ASSET-constant" title="Keoken::TYPE_CREATE_ASSET (constant)">TYPE_CREATE_ASSET</a></span></span><span class='comma'>,</span>
|
620
|
+
<span class='id identifier rubyid_name_to_hex'>name_to_hex</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span><span class='comma'>,</span>
|
621
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX_BYTE_AMOUNT-constant" title="Keoken::PREFIX_BYTE_AMOUNT (constant)">PREFIX_BYTE_AMOUNT</a></span></span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='id identifier rubyid_prefix_length'>prefix_length</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='id identifier rubyid_amount'>amount</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span>
|
622
|
+
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
601
623
|
<span class='kw'>self</span>
|
602
624
|
<span class='kw'>end</span></pre>
|
603
625
|
</td>
|
604
626
|
</tr>
|
605
627
|
</table>
|
628
|
+
</div>
|
629
|
+
|
630
|
+
<div class="method_details ">
|
631
|
+
<h3 class="signature " id="hex-instance_method">
|
632
|
+
|
633
|
+
#<strong>hex</strong> ⇒ <tt>String</tt>
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
</h3><div class="docstring">
|
640
|
+
<div class="discussion">
|
641
|
+
Hexadecimal value of script.
|
642
|
+
|
643
|
+
</div>
|
644
|
+
</div>
|
645
|
+
<div class="tags">
|
646
|
+
|
647
|
+
<p class="tag_title">Returns:</p>
|
648
|
+
<ul class="return">
|
649
|
+
|
650
|
+
<li>
|
651
|
+
|
652
|
+
|
653
|
+
<span class='type'>(<tt>String</tt>)</span>
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
—
|
658
|
+
<div class='inline'>Hexadecimal value of script token.</div>
|
659
|
+
|
660
|
+
</li>
|
661
|
+
|
662
|
+
</ul>
|
663
|
+
|
664
|
+
</div><table class="source_code">
|
665
|
+
<tr>
|
666
|
+
<td>
|
667
|
+
<pre class="lines">
|
668
|
+
|
669
|
+
|
670
|
+
60
|
671
|
+
61
|
672
|
+
62
|
673
|
+
63
|
674
|
+
64
|
675
|
+
65
|
676
|
+
66
|
677
|
+
67</pre>
|
678
|
+
</td>
|
679
|
+
<td>
|
680
|
+
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 60</span>
|
681
|
+
|
682
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hex'>hex</span>
|
683
|
+
<span class='lbracket'>[</span>
|
684
|
+
<span class='const'>Bitcoin</span><span class='op'>::</span><span class='const'>Script</span><span class='op'>::</span><span class='const'>OP_RETURN</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='comma'>,</span>
|
685
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX_SIZE-constant" title="Keoken::PREFIX_SIZE (constant)">PREFIX_SIZE</a></span></span><span class='comma'>,</span>
|
686
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX-constant" title="Keoken::PREFIX (constant)">PREFIX</a></span></span><span class='comma'>,</span>
|
687
|
+
<span class='id identifier rubyid_data_length'>data_length</span>
|
688
|
+
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='op'>+</span> <span class='ivar'>@data_script</span>
|
689
|
+
<span class='kw'>end</span></pre>
|
690
|
+
</td>
|
691
|
+
</tr>
|
692
|
+
</table>
|
606
693
|
</div>
|
607
694
|
|
608
695
|
<div class="method_details ">
|
@@ -687,30 +774,124 @@
|
|
687
774
|
52
|
688
775
|
53
|
689
776
|
54
|
690
|
-
55
|
691
|
-
56
|
692
|
-
57
|
693
|
-
58
|
694
|
-
59</pre>
|
777
|
+
55</pre>
|
695
778
|
</td>
|
696
779
|
<td>
|
697
780
|
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 44</span>
|
698
781
|
|
699
782
|
<span class='kw'>def</span> <span class='id identifier rubyid_send_amount'>send_amount</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='rparen'>)</span>
|
700
783
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="IdNotFound.html" title="Keoken::IdNotFound (class)">IdNotFound</a></span></span> <span class='kw'>unless</span> <span class='ivar'>@id</span>
|
701
|
-
<span class='id identifier
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
784
|
+
<span class='id identifier rubyid_asset_length'>asset_length</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#ASSET_ID_SIZE-constant" title="Keoken::ASSET_ID_SIZE (constant)">ASSET_ID_SIZE</a></span></span> <span class='op'>-</span> <span class='ivar'>@id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>-</span> <span class='int'>1</span>
|
785
|
+
<span class='ivar'>@data_script</span> <span class='op'>=</span>
|
786
|
+
<span class='lbracket'>[</span>
|
787
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#VERSION_NODE-constant" title="Keoken::VERSION_NODE (constant)">VERSION_NODE</a></span></span><span class='comma'>,</span>
|
788
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#TYPE_SEND_TOKEN-constant" title="Keoken::TYPE_SEND_TOKEN (constant)">TYPE_SEND_TOKEN</a></span></span><span class='comma'>,</span>
|
789
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX_BYTE_ASSET_ID-constant" title="Keoken::PREFIX_BYTE_ASSET_ID (constant)">PREFIX_BYTE_ASSET_ID</a></span></span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='id identifier rubyid_asset_length'>asset_length</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='ivar'>@id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span>
|
790
|
+
<span class='const'><span class='object_link'><a href="../Keoken.html" title="Keoken (module)">Keoken</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Keoken.html#PREFIX_BYTE_AMOUNT-constant" title="Keoken::PREFIX_BYTE_AMOUNT (constant)">PREFIX_BYTE_AMOUNT</a></span></span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='id identifier rubyid_prefix_length'>prefix_length</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>+</span> <span class='id identifier rubyid_amount'>amount</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span>
|
791
|
+
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
792
|
+
<span class='kw'>self</span>
|
793
|
+
<span class='kw'>end</span></pre>
|
794
|
+
</td>
|
795
|
+
</tr>
|
796
|
+
</table>
|
797
|
+
</div>
|
798
|
+
|
799
|
+
<div class="method_details ">
|
800
|
+
<h3 class="signature " id="to_hash-instance_method">
|
801
|
+
|
802
|
+
#<strong>to_hash</strong> ⇒ <tt>Object</tt>
|
803
|
+
|
804
|
+
|
805
|
+
|
806
|
+
|
807
|
+
|
808
|
+
</h3><div class="docstring">
|
809
|
+
<div class="discussion">
|
810
|
+
Deserialization of object
|
706
811
|
|
707
|
-
|
812
|
+
return [Hash] Deserialization of token object.
|
813
|
+
|
814
|
+
</div>
|
815
|
+
</div>
|
816
|
+
<div class="tags">
|
817
|
+
|
818
|
+
|
819
|
+
</div><table class="source_code">
|
820
|
+
<tr>
|
821
|
+
<td>
|
822
|
+
<pre class="lines">
|
708
823
|
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
824
|
+
|
825
|
+
84
|
826
|
+
85
|
827
|
+
86
|
828
|
+
87
|
829
|
+
88
|
830
|
+
89
|
831
|
+
90
|
832
|
+
91</pre>
|
833
|
+
</td>
|
834
|
+
<td>
|
835
|
+
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 84</span>
|
836
|
+
|
837
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_hash'>to_hash</span>
|
838
|
+
<span class='lbrace'>{</span>
|
839
|
+
<span class='label'>id:</span> <span class='ivar'>@id</span><span class='comma'>,</span>
|
840
|
+
<span class='label'>name:</span> <span class='ivar'>@name</span><span class='comma'>,</span>
|
841
|
+
<span class='label'>amount:</span> <span class='ivar'>@amount</span><span class='comma'>,</span>
|
842
|
+
<span class='label'>transaction_type:</span> <span class='ivar'>@transaction_type</span>
|
843
|
+
<span class='rbrace'>}</span>
|
844
|
+
<span class='kw'>end</span></pre>
|
845
|
+
</td>
|
846
|
+
</tr>
|
847
|
+
</table>
|
848
|
+
</div>
|
849
|
+
|
850
|
+
<div class="method_details ">
|
851
|
+
<h3 class="signature " id="to_json-instance_method">
|
852
|
+
|
853
|
+
#<strong>to_json</strong> ⇒ <tt>Object</tt>
|
854
|
+
|
855
|
+
|
856
|
+
|
857
|
+
|
858
|
+
|
859
|
+
</h3><div class="docstring">
|
860
|
+
<div class="discussion">
|
861
|
+
JSON serialization of object
|
862
|
+
|
863
|
+
return [String] JSON serialization of token object.
|
864
|
+
|
865
|
+
</div>
|
866
|
+
</div>
|
867
|
+
<div class="tags">
|
868
|
+
|
869
|
+
|
870
|
+
</div><table class="source_code">
|
871
|
+
<tr>
|
872
|
+
<td>
|
873
|
+
<pre class="lines">
|
874
|
+
|
875
|
+
|
876
|
+
72
|
877
|
+
73
|
878
|
+
74
|
879
|
+
75
|
880
|
+
76
|
881
|
+
77
|
882
|
+
78
|
883
|
+
79</pre>
|
884
|
+
</td>
|
885
|
+
<td>
|
886
|
+
<pre class="code"><span class="info file"># File 'lib/keoken/token.rb', line 72</span>
|
887
|
+
|
888
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span>
|
889
|
+
<span class='lbrace'>{</span>
|
890
|
+
<span class='label'>id:</span> <span class='ivar'>@id</span><span class='comma'>,</span>
|
891
|
+
<span class='label'>name:</span> <span class='ivar'>@name</span><span class='comma'>,</span>
|
892
|
+
<span class='label'>amount:</span> <span class='ivar'>@amount</span><span class='comma'>,</span>
|
893
|
+
<span class='label'>transaction_type:</span> <span class='ivar'>@transaction_type</span>
|
894
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span>
|
714
895
|
<span class='kw'>end</span></pre>
|
715
896
|
</td>
|
716
897
|
</tr>
|
@@ -722,7 +903,7 @@
|
|
722
903
|
</div>
|
723
904
|
|
724
905
|
<div id="footer">
|
725
|
-
Generated on
|
906
|
+
Generated on Tue Feb 5 12:51:34 2019 by
|
726
907
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
727
908
|
0.9.18 (ruby-2.3.3).
|
728
909
|
</div>
|