elephas 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.gitignore +5 -0
  2. data/.travis.yml +8 -0
  3. data/.yardopts +1 -0
  4. data/Gemfile +9 -0
  5. data/README.md +28 -0
  6. data/Rakefile +18 -0
  7. data/doc/Elephas/Cache.html +815 -0
  8. data/doc/Elephas/Entry.html +1085 -0
  9. data/doc/Elephas/Exceptions.html +115 -0
  10. data/doc/Elephas/Providers/Base.html +701 -0
  11. data/doc/Elephas/Providers/Hash.html +775 -0
  12. data/doc/Elephas/Providers/RubyOnRails.html +609 -0
  13. data/doc/Elephas/Providers.html +129 -0
  14. data/doc/Elephas/Version.html +189 -0
  15. data/doc/Elephas.html +130 -0
  16. data/doc/_index.html +207 -0
  17. data/doc/class_list.html +53 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +57 -0
  20. data/doc/css/style.css +328 -0
  21. data/doc/file.README.html +103 -0
  22. data/doc/file_list.html +55 -0
  23. data/doc/frames.html +28 -0
  24. data/doc/index.html +103 -0
  25. data/doc/js/app.js +214 -0
  26. data/doc/js/full_list.js +173 -0
  27. data/doc/js/jquery.js +4 -0
  28. data/doc/method_list.html +300 -0
  29. data/doc/top-level-namespace.html +112 -0
  30. data/elephas.gemspec +34 -0
  31. data/lib/elephas/cache.rb +89 -0
  32. data/lib/elephas/entry.rb +86 -0
  33. data/lib/elephas/provider.rb +57 -0
  34. data/lib/elephas/providers/hash.rb +65 -0
  35. data/lib/elephas/providers/ruby_on_rails.rb +57 -0
  36. data/lib/elephas/version.rb +25 -0
  37. data/lib/elephas.rb +20 -0
  38. data/spec/coverage_helper.rb +19 -0
  39. data/spec/elephas/cache_spec.rb +41 -0
  40. data/spec/elephas/entry_spec.rb +11 -0
  41. data/spec/elephas/provider_spec.rb +46 -0
  42. data/spec/elephas/providers/hash_spec.rb +80 -0
  43. data/spec/elephas/providers/ruby_on_rails_spec.rb +86 -0
  44. data/spec/spec_helper.rb +16 -0
  45. metadata +231 -0
@@ -0,0 +1,775 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Elephas::Providers::Hash
8
+
9
+ &mdash; Documentation by YARD 0.8.2.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (H)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Elephas.html" title="Elephas (module)">Elephas</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Providers.html" title="Elephas::Providers (module)">Providers</a></span></span>
36
+ &raquo;
37
+ <span class="title">Hash</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Elephas::Providers::Hash
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Elephas::Providers::Hash</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2"><span class='object_link'><a href="Base.html" title="Elephas::Providers::Base (module)">Base</a></span></dd>
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/elephas/providers/hash.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+ <p>This is a simple providers, which uses an hash for storing the values.</p>
109
+
110
+
111
+ </div>
112
+ </div>
113
+ <div class="tags">
114
+
115
+
116
+ </div>
117
+
118
+
119
+
120
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
121
+ <ul class="summary">
122
+
123
+ <li class="public ">
124
+ <span class="summary_signature">
125
+
126
+ <a href="#data-instance_method" title="#data (instance method)">- (Object) <strong>data</strong> </a>
127
+
128
+
129
+
130
+ </span>
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ <span class="summary_desc"><div class='inline'><p>The internal hash used by the provider.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ </ul>
150
+
151
+
152
+
153
+
154
+
155
+ <h2>
156
+ Instance Method Summary
157
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
158
+ </h2>
159
+
160
+ <ul class="summary">
161
+
162
+ <li class="public ">
163
+ <span class="summary_signature">
164
+
165
+ <a href="#delete-instance_method" title="#delete (instance method)">- (Boolean) <strong>delete</strong>(key) </a>
166
+
167
+
168
+
169
+ </span>
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+ <span class="summary_desc"><div class='inline'><p>Deletes a value from the cache.</p>
180
+ </div></span>
181
+
182
+ </li>
183
+
184
+
185
+ <li class="public ">
186
+ <span class="summary_signature">
187
+
188
+ <a href="#exists%3F-instance_method" title="#exists? (instance method)">- (Boolean) <strong>exists?</strong>(key) </a>
189
+
190
+
191
+
192
+ </span>
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+ <span class="summary_desc"><div class='inline'><p>Checks if a key exists in the cache.</p>
203
+ </div></span>
204
+
205
+ </li>
206
+
207
+
208
+ <li class="public ">
209
+ <span class="summary_signature">
210
+
211
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Hash) <strong>initialize</strong>(data = nil) </a>
212
+
213
+
214
+
215
+ </span>
216
+
217
+
218
+ <span class="note title constructor">constructor</span>
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+ <span class="summary_desc"><div class='inline'><p>Initialize the provider.</p>
228
+ </div></span>
229
+
230
+ </li>
231
+
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#read-instance_method" title="#read (instance method)">- (Entry|NilClass) <strong>read</strong>(key) </a>
237
+
238
+
239
+
240
+ </span>
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <span class="summary_desc"><div class='inline'><p>Reads a value from the cache.</p>
251
+ </div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#write-instance_method" title="#write (instance method)">- (Object) <strong>write</strong>(key, value, options = {}) </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'><p>Writes a value to the cache.</p>
274
+ </div></span>
275
+
276
+ </li>
277
+
278
+
279
+ </ul>
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="Base.html" title="Elephas::Providers::Base (module)">Base</a></span></h3>
292
+ <p class="inherited"><span class='object_link'><a href="Base.html#now-instance_method" title="Elephas::Providers::Base#now (method)">#now</a></span></p>
293
+
294
+ <div id="constructor_details" class="method_details_list">
295
+ <h2>Constructor Details</h2>
296
+
297
+ <div class="method_details first">
298
+ <h3 class="signature first" id="initialize-instance_method">
299
+
300
+ - (<tt><span class='object_link'><a href="" title="Elephas::Providers::Hash (class)">Hash</a></span></tt>) <strong>initialize</strong>(data = nil)
301
+
302
+
303
+
304
+
305
+
306
+ </h3><div class="docstring">
307
+ <div class="discussion">
308
+ <p>Initialize the provider</p>
309
+
310
+
311
+ </div>
312
+ </div>
313
+ <div class="tags">
314
+ <p class="tag_title">Parameters:</p>
315
+ <ul class="param">
316
+
317
+ <li>
318
+
319
+ <span class='name'>data</span>
320
+
321
+
322
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Elephas::Providers::Hash (class)">Hash</a></span></tt>)</span>
323
+
324
+
325
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
326
+
327
+
328
+ &mdash;
329
+ <div class='inline'><p>The initial data stored.</p>
330
+ </div>
331
+
332
+ </li>
333
+
334
+ </ul>
335
+
336
+
337
+ </div><table class="source_code">
338
+ <tr>
339
+ <td>
340
+ <pre class="lines">
341
+
342
+
343
+ 18
344
+ 19
345
+ 20
346
+ 21</pre>
347
+ </td>
348
+ <td>
349
+ <pre class="code"><span class="info file"># File 'lib/elephas/providers/hash.rb', line 18</span>
350
+
351
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
352
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_data'>data</span> <span class='op'>||</span> <span class='op'>!</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span>
353
+ <span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span>
354
+ <span class='kw'>end</span></pre>
355
+ </td>
356
+ </tr>
357
+ </table>
358
+ </div>
359
+
360
+ </div>
361
+
362
+ <div id="instance_attr_details" class="attr_details">
363
+ <h2>Instance Attribute Details</h2>
364
+
365
+
366
+ <span id="data=-instance_method"></span>
367
+ <div class="method_details first">
368
+ <h3 class="signature first" id="data-instance_method">
369
+
370
+ - (<tt>Object</tt>) <strong>data</strong>
371
+
372
+
373
+
374
+
375
+
376
+ </h3><div class="docstring">
377
+ <div class="discussion">
378
+ <p>The internal hash used by the provider.</p>
379
+
380
+
381
+ </div>
382
+ </div>
383
+ <div class="tags">
384
+
385
+
386
+ </div><table class="source_code">
387
+ <tr>
388
+ <td>
389
+ <pre class="lines">
390
+
391
+
392
+ 14
393
+ 15
394
+ 16</pre>
395
+ </td>
396
+ <td>
397
+ <pre class="code"><span class="info file"># File 'lib/elephas/providers/hash.rb', line 14</span>
398
+
399
+ <span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
400
+ <span class='ivar'>@data</span>
401
+ <span class='kw'>end</span></pre>
402
+ </td>
403
+ </tr>
404
+ </table>
405
+ </div>
406
+
407
+ </div>
408
+
409
+
410
+ <div id="instance_method_details" class="method_details_list">
411
+ <h2>Instance Method Details</h2>
412
+
413
+
414
+ <div class="method_details first">
415
+ <h3 class="signature first" id="delete-instance_method">
416
+
417
+ - (<tt>Boolean</tt>) <strong>delete</strong>(key)
418
+
419
+
420
+
421
+
422
+
423
+ </h3><div class="docstring">
424
+ <div class="discussion">
425
+ <p>Deletes a value from the cache.</p>
426
+
427
+
428
+ </div>
429
+ </div>
430
+ <div class="tags">
431
+ <p class="tag_title">Parameters:</p>
432
+ <ul class="param">
433
+
434
+ <li>
435
+
436
+ <span class='name'>key</span>
437
+
438
+
439
+ <span class='type'>(<tt>String</tt>)</span>
440
+
441
+
442
+
443
+ &mdash;
444
+ <div class='inline'><p>The key to delete.</p>
445
+ </div>
446
+
447
+ </li>
448
+
449
+ </ul>
450
+
451
+ <p class="tag_title">Returns:</p>
452
+ <ul class="return">
453
+
454
+ <li>
455
+
456
+
457
+ <span class='type'>(<tt>Boolean</tt>)</span>
458
+
459
+
460
+
461
+ &mdash;
462
+ <div class='inline'><p><code>true</code> if the key was in the cache, <code>false</code> otherwise.</p>
463
+ </div>
464
+
465
+ </li>
466
+
467
+ </ul>
468
+
469
+ </div><table class="source_code">
470
+ <tr>
471
+ <td>
472
+ <pre class="lines">
473
+
474
+
475
+ 48
476
+ 49
477
+ 50
478
+ 51
479
+ 52
480
+ 53</pre>
481
+ </td>
482
+ <td>
483
+ <pre class="code"><span class="info file"># File 'lib/elephas/providers/hash.rb', line 48</span>
484
+
485
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
486
+ <span class='id identifier rubyid_fkey'>fkey</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
487
+ <span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_fkey'>fkey</span><span class='rparen'>)</span>
488
+ <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_fkey'>fkey</span><span class='rparen'>)</span>
489
+ <span class='id identifier rubyid_rv'>rv</span>
490
+ <span class='kw'>end</span></pre>
491
+ </td>
492
+ </tr>
493
+ </table>
494
+ </div>
495
+
496
+ <div class="method_details ">
497
+ <h3 class="signature " id="exists?-instance_method">
498
+
499
+ - (<tt>Boolean</tt>) <strong>exists?</strong>(key)
500
+
501
+
502
+
503
+
504
+
505
+ </h3><div class="docstring">
506
+ <div class="discussion">
507
+ <p>Checks if a key exists in the cache.</p>
508
+
509
+
510
+ </div>
511
+ </div>
512
+ <div class="tags">
513
+ <p class="tag_title">Parameters:</p>
514
+ <ul class="param">
515
+
516
+ <li>
517
+
518
+ <span class='name'>key</span>
519
+
520
+
521
+ <span class='type'>(<tt>String</tt>)</span>
522
+
523
+
524
+
525
+ &mdash;
526
+ <div class='inline'><p>The key to lookup.</p>
527
+ </div>
528
+
529
+ </li>
530
+
531
+ </ul>
532
+
533
+ <p class="tag_title">Returns:</p>
534
+ <ul class="return">
535
+
536
+ <li>
537
+
538
+
539
+ <span class='type'>(<tt>Boolean</tt>)</span>
540
+
541
+
542
+
543
+ &mdash;
544
+ <div class='inline'><p><code>true</code> if the key is in the cache, <code>false</code> otherwise.</p>
545
+ </div>
546
+
547
+ </li>
548
+
549
+ </ul>
550
+
551
+ </div><table class="source_code">
552
+ <tr>
553
+ <td>
554
+ <pre class="lines">
555
+
556
+
557
+ 59
558
+ 60
559
+ 61
560
+ 62</pre>
561
+ </td>
562
+ <td>
563
+ <pre class="code"><span class="info file"># File 'lib/elephas/providers/hash.rb', line 59</span>
564
+
565
+ <span class='kw'>def</span> <span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
566
+ <span class='id identifier rubyid_fkey'>fkey</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
567
+ <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_fkey'>fkey</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_fkey'>fkey</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_valid?'>valid?</span>
568
+ <span class='kw'>end</span></pre>
569
+ </td>
570
+ </tr>
571
+ </table>
572
+ </div>
573
+
574
+ <div class="method_details ">
575
+ <h3 class="signature " id="read-instance_method">
576
+
577
+ - (<tt><span class='object_link'><a href="../Entry.html" title="Elephas::Entry (class)">Entry</a></span>|NilClass</tt>) <strong>read</strong>(key)
578
+
579
+
580
+
581
+
582
+
583
+ </h3><div class="docstring">
584
+ <div class="discussion">
585
+ <p>Reads a value from the cache.</p>
586
+
587
+
588
+ </div>
589
+ </div>
590
+ <div class="tags">
591
+ <p class="tag_title">Parameters:</p>
592
+ <ul class="param">
593
+
594
+ <li>
595
+
596
+ <span class='name'>key</span>
597
+
598
+
599
+ <span class='type'>(<tt>String</tt>)</span>
600
+
601
+
602
+
603
+ &mdash;
604
+ <div class='inline'><p>The key to lookup.</p>
605
+ </div>
606
+
607
+ </li>
608
+
609
+ </ul>
610
+
611
+ <p class="tag_title">Returns:</p>
612
+ <ul class="return">
613
+
614
+ <li>
615
+
616
+
617
+ <span class='type'>(<tt><span class='object_link'><a href="../Entry.html" title="Elephas::Entry (class)">Entry</a></span>|NilClass</tt>)</span>
618
+
619
+
620
+
621
+ &mdash;
622
+ <div class='inline'><p>The read value or <code>nil</code>.</p>
623
+ </div>
624
+
625
+ </li>
626
+
627
+ </ul>
628
+
629
+ </div><table class="source_code">
630
+ <tr>
631
+ <td>
632
+ <pre class="lines">
633
+
634
+
635
+ 27
636
+ 28
637
+ 29</pre>
638
+ </td>
639
+ <td>
640
+ <pre class="code"><span class="info file"># File 'lib/elephas/providers/hash.rb', line 27</span>
641
+
642
+ <span class='kw'>def</span> <span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
643
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='kw'>nil</span>
644
+ <span class='kw'>end</span></pre>
645
+ </td>
646
+ </tr>
647
+ </table>
648
+ </div>
649
+
650
+ <div class="method_details ">
651
+ <h3 class="signature " id="write-instance_method">
652
+
653
+ - (<tt>Object</tt>) <strong>write</strong>(key, value, options = {})
654
+
655
+
656
+
657
+
658
+
659
+ </h3><div class="docstring">
660
+ <div class="discussion">
661
+ <p>Writes a value to the cache.</p>
662
+
663
+
664
+ </div>
665
+ </div>
666
+ <div class="tags">
667
+ <p class="tag_title">Parameters:</p>
668
+ <ul class="param">
669
+
670
+ <li>
671
+
672
+ <span class='name'>key</span>
673
+
674
+
675
+ <span class='type'>(<tt>String</tt>)</span>
676
+
677
+
678
+
679
+ &mdash;
680
+ <div class='inline'><p>The key to associate the value with.</p>
681
+ </div>
682
+
683
+ </li>
684
+
685
+ <li>
686
+
687
+ <span class='name'>value</span>
688
+
689
+
690
+ <span class='type'>(<tt>Object</tt>)</span>
691
+
692
+
693
+
694
+ &mdash;
695
+ <div class='inline'><p>The value to write. *<em>Setting a value to <code>nil</code> doesn&#39;t mean *deleting</em> the value.</p>
696
+ </div>
697
+
698
+ </li>
699
+
700
+ <li>
701
+
702
+ <span class='name'>options</span>
703
+
704
+
705
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Elephas::Providers::Hash (class)">Hash</a></span></tt>)</span>
706
+
707
+
708
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
709
+
710
+
711
+ &mdash;
712
+ <div class='inline'><p>A list of options for writing. @see Elephas::Cache.write</p>
713
+ </div>
714
+
715
+ </li>
716
+
717
+ </ul>
718
+
719
+ <p class="tag_title">Returns:</p>
720
+ <ul class="return">
721
+
722
+ <li>
723
+
724
+
725
+ <span class='type'>(<tt>Object</tt>)</span>
726
+
727
+
728
+
729
+ &mdash;
730
+ <div class='inline'><p>The value itself.</p>
731
+ </div>
732
+
733
+ </li>
734
+
735
+ </ul>
736
+
737
+ </div><table class="source_code">
738
+ <tr>
739
+ <td>
740
+ <pre class="lines">
741
+
742
+
743
+ 37
744
+ 38
745
+ 39
746
+ 40
747
+ 41
748
+ 42</pre>
749
+ </td>
750
+ <td>
751
+ <pre class="code"><span class="info file"># File 'lib/elephas/providers/hash.rb', line 37</span>
752
+
753
+ <span class='kw'>def</span> <span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</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>
754
+ <span class='id identifier rubyid_fvalue'>fvalue</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>Elephas</span><span class='op'>::</span><span class='const'>Entry</span><span class='period'>.</span><span class='id identifier rubyid_ensure'>ensure</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
755
+ <span class='id identifier rubyid_fvalue'>fvalue</span><span class='period'>.</span><span class='id identifier rubyid_refresh'>refresh</span>
756
+ <span class='ivar'>@data</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_fvalue'>fvalue</span>
757
+ <span class='id identifier rubyid_value'>value</span>
758
+ <span class='kw'>end</span></pre>
759
+ </td>
760
+ </tr>
761
+ </table>
762
+ </div>
763
+
764
+ </div>
765
+
766
+ </div>
767
+
768
+ <div id="footer">
769
+ Generated on Sat Jul 28 14:29:52 2012 by
770
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
771
+ 0.8.2.1 (ruby-1.9.2).
772
+ </div>
773
+
774
+ </body>
775
+ </html>