option_lab 0.1.0

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.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +139 -0
  4. data/.yard/hooks/before_generate.rb +7 -0
  5. data/.yardopts +11 -0
  6. data/Gemfile +26 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +180 -0
  9. data/Rakefile +44 -0
  10. data/docs/OptionLab/BinomialTree.html +1271 -0
  11. data/docs/OptionLab/BjerksundStensland.html +2022 -0
  12. data/docs/OptionLab/BlackScholes.html +2388 -0
  13. data/docs/OptionLab/Engine.html +1716 -0
  14. data/docs/OptionLab/Models/AmericanModelInputs.html +937 -0
  15. data/docs/OptionLab/Models/ArrayInputs.html +463 -0
  16. data/docs/OptionLab/Models/BaseModel.html +223 -0
  17. data/docs/OptionLab/Models/BinomialModelInputs.html +1161 -0
  18. data/docs/OptionLab/Models/BlackScholesInfo.html +967 -0
  19. data/docs/OptionLab/Models/BlackScholesModelInputs.html +851 -0
  20. data/docs/OptionLab/Models/ClosedPosition.html +445 -0
  21. data/docs/OptionLab/Models/EngineData.html +2523 -0
  22. data/docs/OptionLab/Models/EngineDataResults.html +435 -0
  23. data/docs/OptionLab/Models/Inputs.html +2241 -0
  24. data/docs/OptionLab/Models/LaplaceInputs.html +777 -0
  25. data/docs/OptionLab/Models/Option.html +736 -0
  26. data/docs/OptionLab/Models/Outputs.html +1753 -0
  27. data/docs/OptionLab/Models/PoPOutputs.html +645 -0
  28. data/docs/OptionLab/Models/PricingResult.html +848 -0
  29. data/docs/OptionLab/Models/Stock.html +583 -0
  30. data/docs/OptionLab/Models/TreeVisualization.html +688 -0
  31. data/docs/OptionLab/Models.html +251 -0
  32. data/docs/OptionLab/Plotting.html +548 -0
  33. data/docs/OptionLab/Support.html +2884 -0
  34. data/docs/OptionLab/Utils.html +619 -0
  35. data/docs/OptionLab.html +133 -0
  36. data/docs/_index.html +376 -0
  37. data/docs/class_list.html +54 -0
  38. data/docs/css/common.css +1 -0
  39. data/docs/css/full_list.css +58 -0
  40. data/docs/css/style.css +503 -0
  41. data/docs/file.LICENSE.html +70 -0
  42. data/docs/file.README.html +263 -0
  43. data/docs/file_list.html +64 -0
  44. data/docs/frames.html +22 -0
  45. data/docs/index.html +263 -0
  46. data/docs/js/app.js +344 -0
  47. data/docs/js/full_list.js +242 -0
  48. data/docs/js/jquery.js +4 -0
  49. data/docs/method_list.html +1974 -0
  50. data/docs/top-level-namespace.html +110 -0
  51. data/examples/american_options.rb +163 -0
  52. data/examples/covered_call.rb +76 -0
  53. data/lib/option_lab/binomial_tree.rb +238 -0
  54. data/lib/option_lab/bjerksund_stensland.rb +276 -0
  55. data/lib/option_lab/black_scholes.rb +323 -0
  56. data/lib/option_lab/engine.rb +492 -0
  57. data/lib/option_lab/models.rb +768 -0
  58. data/lib/option_lab/plotting.rb +182 -0
  59. data/lib/option_lab/support.rb +471 -0
  60. data/lib/option_lab/utils.rb +107 -0
  61. data/lib/option_lab/version.rb +5 -0
  62. data/lib/option_lab.rb +134 -0
  63. data/option_lab.gemspec +43 -0
  64. metadata +207 -0
@@ -0,0 +1,851 @@
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: OptionLab::Models::BlackScholesModelInputs
8
+
9
+ &mdash; OptionLab Documentation
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "OptionLab::Models::BlackScholesModelInputs";
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 (B)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../OptionLab.html" title="OptionLab (module)">OptionLab</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Models.html" title="OptionLab::Models (module)">Models</a></span></span>
41
+ &raquo;
42
+ <span class="title">BlackScholesModelInputs</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: OptionLab::Models::BlackScholesModelInputs
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="BaseModel.html" title="OptionLab::Models::BaseModel (class)">BaseModel</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="BaseModel.html" title="OptionLab::Models::BaseModel (class)">BaseModel</a></span></li>
78
+
79
+ <li class="next">OptionLab::Models::BlackScholesModelInputs</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/option_lab/models.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+ <p>Black-Scholes model inputs</p>
107
+
108
+
109
+ </div>
110
+ </div>
111
+ <div class="tags">
112
+
113
+
114
+ </div>
115
+
116
+
117
+
118
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
119
+ <ul class="summary">
120
+
121
+ <li class="public ">
122
+ <span class="summary_signature">
123
+
124
+ <a href="#dividend_yield-instance_method" title="#dividend_yield (instance method)">#<strong>dividend_yield</strong> &#x21d2; Object </a>
125
+
126
+
127
+
128
+ </span>
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute dividend_yield.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ <li class="public ">
148
+ <span class="summary_signature">
149
+
150
+ <a href="#interest_rate-instance_method" title="#interest_rate (instance method)">#<strong>interest_rate</strong> &#x21d2; Object </a>
151
+
152
+
153
+
154
+ </span>
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute interest_rate.</p>
168
+ </div></span>
169
+
170
+ </li>
171
+
172
+
173
+ <li class="public ">
174
+ <span class="summary_signature">
175
+
176
+ <a href="#model-instance_method" title="#model (instance method)">#<strong>model</strong> &#x21d2; Object </a>
177
+
178
+
179
+
180
+ </span>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute model.</p>
194
+ </div></span>
195
+
196
+ </li>
197
+
198
+
199
+ <li class="public ">
200
+ <span class="summary_signature">
201
+
202
+ <a href="#stock_price-instance_method" title="#stock_price (instance method)">#<strong>stock_price</strong> &#x21d2; Object </a>
203
+
204
+
205
+
206
+ </span>
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute stock_price.</p>
220
+ </div></span>
221
+
222
+ </li>
223
+
224
+
225
+ <li class="public ">
226
+ <span class="summary_signature">
227
+
228
+ <a href="#volatility-instance_method" title="#volatility (instance method)">#<strong>volatility</strong> &#x21d2; Object </a>
229
+
230
+
231
+
232
+ </span>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute volatility.</p>
246
+ </div></span>
247
+
248
+ </li>
249
+
250
+
251
+ <li class="public ">
252
+ <span class="summary_signature">
253
+
254
+ <a href="#years_to_target_date-instance_method" title="#years_to_target_date (instance method)">#<strong>years_to_target_date</strong> &#x21d2; Object </a>
255
+
256
+
257
+
258
+ </span>
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute years_to_target_date.</p>
272
+ </div></span>
273
+
274
+ </li>
275
+
276
+
277
+ </ul>
278
+
279
+
280
+
281
+
282
+
283
+ <h2>
284
+ Instance Method Summary
285
+ <small><a href="#" class="summary_toggle">collapse</a></small>
286
+ </h2>
287
+
288
+ <ul class="summary">
289
+
290
+ <li class="public ">
291
+ <span class="summary_signature">
292
+
293
+ <a href="#==-instance_method" title="#== (instance method)">#<strong>==</strong>(other) &#x21d2; Object </a>
294
+
295
+
296
+
297
+ (also: #eql?)
298
+
299
+ </span>
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+ <span class="summary_desc"><div class='inline'></div></span>
310
+
311
+ </li>
312
+
313
+
314
+ <li class="public ">
315
+ <span class="summary_signature">
316
+
317
+ <a href="#hash-instance_method" title="#hash (instance method)">#<strong>hash</strong> &#x21d2; Object </a>
318
+
319
+
320
+
321
+ </span>
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
331
+ <span class="summary_desc"><div class='inline'></div></span>
332
+
333
+ </li>
334
+
335
+
336
+ <li class="public ">
337
+ <span class="summary_signature">
338
+
339
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(attributes = {}) &#x21d2; BlackScholesModelInputs </a>
340
+
341
+
342
+
343
+ </span>
344
+
345
+
346
+ <span class="note title constructor">constructor</span>
347
+
348
+
349
+
350
+
351
+
352
+
353
+
354
+
355
+ <span class="summary_desc"><div class='inline'><p>A new instance of BlackScholesModelInputs.</p>
356
+ </div></span>
357
+
358
+ </li>
359
+
360
+
361
+ <li class="public ">
362
+ <span class="summary_signature">
363
+
364
+ <a href="#validate!-instance_method" title="#validate! (instance method)">#<strong>validate!</strong> &#x21d2; Object </a>
365
+
366
+
367
+
368
+ </span>
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+ <span class="summary_desc"><div class='inline'></div></span>
379
+
380
+ </li>
381
+
382
+
383
+ </ul>
384
+
385
+
386
+
387
+
388
+ <div id="constructor_details" class="method_details_list">
389
+ <h2>Constructor Details</h2>
390
+
391
+ <div class="method_details first">
392
+ <h3 class="signature first" id="initialize-instance_method">
393
+
394
+ #<strong>initialize</strong>(attributes = {}) &#x21d2; <tt><span class='object_link'><a href="" title="OptionLab::Models::BlackScholesModelInputs (class)">BlackScholesModelInputs</a></span></tt>
395
+
396
+
397
+
398
+
399
+
400
+ </h3><div class="docstring">
401
+ <div class="discussion">
402
+ <p>Returns a new instance of BlackScholesModelInputs.</p>
403
+
404
+
405
+ </div>
406
+ </div>
407
+ <div class="tags">
408
+
409
+
410
+ </div><table class="source_code">
411
+ <tr>
412
+ <td>
413
+ <pre class="lines">
414
+
415
+
416
+ 437
417
+ 438
418
+ 439
419
+ 440
420
+ 441
421
+ 442
422
+ 443
423
+ 444
424
+ 445
425
+ 446</pre>
426
+ </td>
427
+ <td>
428
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 437</span>
429
+
430
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
431
+ <span class='comment'># Set defaults
432
+ </span> <span class='ivar'>@interest_rate</span> <span class='op'>=</span> <span class='float'>0.0</span>
433
+ <span class='ivar'>@dividend_yield</span> <span class='op'>=</span> <span class='float'>0.0</span>
434
+ <span class='ivar'>@model</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>black-scholes</span><span class='tstring_end'>&#39;</span></span>
435
+
436
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
437
+
438
+ <span class='id identifier rubyid_validate!'>validate!</span>
439
+ <span class='kw'>end</span></pre>
440
+ </td>
441
+ </tr>
442
+ </table>
443
+ </div>
444
+
445
+ </div>
446
+
447
+ <div id="instance_attr_details" class="attr_details">
448
+ <h2>Instance Attribute Details</h2>
449
+
450
+
451
+ <span id="dividend_yield=-instance_method"></span>
452
+ <div class="method_details first">
453
+ <h3 class="signature first" id="dividend_yield-instance_method">
454
+
455
+ #<strong>dividend_yield</strong> &#x21d2; <tt>Object</tt>
456
+
457
+
458
+
459
+
460
+
461
+ </h3><div class="docstring">
462
+ <div class="discussion">
463
+ <p>Returns the value of attribute dividend_yield.</p>
464
+
465
+
466
+ </div>
467
+ </div>
468
+ <div class="tags">
469
+
470
+
471
+ </div><table class="source_code">
472
+ <tr>
473
+ <td>
474
+ <pre class="lines">
475
+
476
+
477
+ 434
478
+ 435
479
+ 436</pre>
480
+ </td>
481
+ <td>
482
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 434</span>
483
+
484
+ <span class='kw'>def</span> <span class='id identifier rubyid_dividend_yield'>dividend_yield</span>
485
+ <span class='ivar'>@dividend_yield</span>
486
+ <span class='kw'>end</span></pre>
487
+ </td>
488
+ </tr>
489
+ </table>
490
+ </div>
491
+
492
+
493
+ <span id="interest_rate=-instance_method"></span>
494
+ <div class="method_details ">
495
+ <h3 class="signature " id="interest_rate-instance_method">
496
+
497
+ #<strong>interest_rate</strong> &#x21d2; <tt>Object</tt>
498
+
499
+
500
+
501
+
502
+
503
+ </h3><div class="docstring">
504
+ <div class="discussion">
505
+ <p>Returns the value of attribute interest_rate.</p>
506
+
507
+
508
+ </div>
509
+ </div>
510
+ <div class="tags">
511
+
512
+
513
+ </div><table class="source_code">
514
+ <tr>
515
+ <td>
516
+ <pre class="lines">
517
+
518
+
519
+ 434
520
+ 435
521
+ 436</pre>
522
+ </td>
523
+ <td>
524
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 434</span>
525
+
526
+ <span class='kw'>def</span> <span class='id identifier rubyid_interest_rate'>interest_rate</span>
527
+ <span class='ivar'>@interest_rate</span>
528
+ <span class='kw'>end</span></pre>
529
+ </td>
530
+ </tr>
531
+ </table>
532
+ </div>
533
+
534
+
535
+ <span id="model=-instance_method"></span>
536
+ <div class="method_details ">
537
+ <h3 class="signature " id="model-instance_method">
538
+
539
+ #<strong>model</strong> &#x21d2; <tt>Object</tt>
540
+
541
+
542
+
543
+
544
+
545
+ </h3><div class="docstring">
546
+ <div class="discussion">
547
+ <p>Returns the value of attribute model.</p>
548
+
549
+
550
+ </div>
551
+ </div>
552
+ <div class="tags">
553
+
554
+
555
+ </div><table class="source_code">
556
+ <tr>
557
+ <td>
558
+ <pre class="lines">
559
+
560
+
561
+ 434
562
+ 435
563
+ 436</pre>
564
+ </td>
565
+ <td>
566
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 434</span>
567
+
568
+ <span class='kw'>def</span> <span class='id identifier rubyid_model'>model</span>
569
+ <span class='ivar'>@model</span>
570
+ <span class='kw'>end</span></pre>
571
+ </td>
572
+ </tr>
573
+ </table>
574
+ </div>
575
+
576
+
577
+ <span id="stock_price=-instance_method"></span>
578
+ <div class="method_details ">
579
+ <h3 class="signature " id="stock_price-instance_method">
580
+
581
+ #<strong>stock_price</strong> &#x21d2; <tt>Object</tt>
582
+
583
+
584
+
585
+
586
+
587
+ </h3><div class="docstring">
588
+ <div class="discussion">
589
+ <p>Returns the value of attribute stock_price.</p>
590
+
591
+
592
+ </div>
593
+ </div>
594
+ <div class="tags">
595
+
596
+
597
+ </div><table class="source_code">
598
+ <tr>
599
+ <td>
600
+ <pre class="lines">
601
+
602
+
603
+ 434
604
+ 435
605
+ 436</pre>
606
+ </td>
607
+ <td>
608
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 434</span>
609
+
610
+ <span class='kw'>def</span> <span class='id identifier rubyid_stock_price'>stock_price</span>
611
+ <span class='ivar'>@stock_price</span>
612
+ <span class='kw'>end</span></pre>
613
+ </td>
614
+ </tr>
615
+ </table>
616
+ </div>
617
+
618
+
619
+ <span id="volatility=-instance_method"></span>
620
+ <div class="method_details ">
621
+ <h3 class="signature " id="volatility-instance_method">
622
+
623
+ #<strong>volatility</strong> &#x21d2; <tt>Object</tt>
624
+
625
+
626
+
627
+
628
+
629
+ </h3><div class="docstring">
630
+ <div class="discussion">
631
+ <p>Returns the value of attribute volatility.</p>
632
+
633
+
634
+ </div>
635
+ </div>
636
+ <div class="tags">
637
+
638
+
639
+ </div><table class="source_code">
640
+ <tr>
641
+ <td>
642
+ <pre class="lines">
643
+
644
+
645
+ 434
646
+ 435
647
+ 436</pre>
648
+ </td>
649
+ <td>
650
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 434</span>
651
+
652
+ <span class='kw'>def</span> <span class='id identifier rubyid_volatility'>volatility</span>
653
+ <span class='ivar'>@volatility</span>
654
+ <span class='kw'>end</span></pre>
655
+ </td>
656
+ </tr>
657
+ </table>
658
+ </div>
659
+
660
+
661
+ <span id="years_to_target_date=-instance_method"></span>
662
+ <div class="method_details ">
663
+ <h3 class="signature " id="years_to_target_date-instance_method">
664
+
665
+ #<strong>years_to_target_date</strong> &#x21d2; <tt>Object</tt>
666
+
667
+
668
+
669
+
670
+
671
+ </h3><div class="docstring">
672
+ <div class="discussion">
673
+ <p>Returns the value of attribute years_to_target_date.</p>
674
+
675
+
676
+ </div>
677
+ </div>
678
+ <div class="tags">
679
+
680
+
681
+ </div><table class="source_code">
682
+ <tr>
683
+ <td>
684
+ <pre class="lines">
685
+
686
+
687
+ 434
688
+ 435
689
+ 436</pre>
690
+ </td>
691
+ <td>
692
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 434</span>
693
+
694
+ <span class='kw'>def</span> <span class='id identifier rubyid_years_to_target_date'>years_to_target_date</span>
695
+ <span class='ivar'>@years_to_target_date</span>
696
+ <span class='kw'>end</span></pre>
697
+ </td>
698
+ </tr>
699
+ </table>
700
+ </div>
701
+
702
+ </div>
703
+
704
+
705
+ <div id="instance_method_details" class="method_details_list">
706
+ <h2>Instance Method Details</h2>
707
+
708
+
709
+ <div class="method_details first">
710
+ <h3 class="signature first" id="==-instance_method">
711
+
712
+ #<strong>==</strong>(other) &#x21d2; <tt>Object</tt>
713
+
714
+
715
+
716
+ <span class="aliases">Also known as:
717
+ <span class="names"><span id='eql?-instance_method'>eql?</span></span>
718
+ </span>
719
+
720
+
721
+
722
+ </h3><table class="source_code">
723
+ <tr>
724
+ <td>
725
+ <pre class="lines">
726
+
727
+
728
+ 452
729
+ 453
730
+ 454
731
+ 455
732
+ 456
733
+ 457
734
+ 458
735
+ 459
736
+ 460
737
+ 461</pre>
738
+ </td>
739
+ <td>
740
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 452</span>
741
+
742
+ <span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
743
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="OptionLab::Models::BlackScholesModelInputs (class)">BlackScholesModelInputs</a></span></span><span class='rparen'>)</span>
744
+
745
+ <span class='id identifier rubyid_stock_price'>stock_price</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_stock_price'>stock_price</span> <span class='op'>&amp;&amp;</span>
746
+ <span class='id identifier rubyid_volatility'>volatility</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_volatility'>volatility</span> <span class='op'>&amp;&amp;</span>
747
+ <span class='id identifier rubyid_years_to_target_date'>years_to_target_date</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_years_to_target_date'>years_to_target_date</span> <span class='op'>&amp;&amp;</span>
748
+ <span class='id identifier rubyid_interest_rate'>interest_rate</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_interest_rate'>interest_rate</span> <span class='op'>&amp;&amp;</span>
749
+ <span class='id identifier rubyid_dividend_yield'>dividend_yield</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_dividend_yield'>dividend_yield</span> <span class='op'>&amp;&amp;</span>
750
+ <span class='id identifier rubyid_model'>model</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_model'>model</span>
751
+ <span class='kw'>end</span></pre>
752
+ </td>
753
+ </tr>
754
+ </table>
755
+ </div>
756
+
757
+ <div class="method_details ">
758
+ <h3 class="signature " id="hash-instance_method">
759
+
760
+ #<strong>hash</strong> &#x21d2; <tt>Object</tt>
761
+
762
+
763
+
764
+
765
+
766
+ </h3><table class="source_code">
767
+ <tr>
768
+ <td>
769
+ <pre class="lines">
770
+
771
+
772
+ 465
773
+ 466
774
+ 467</pre>
775
+ </td>
776
+ <td>
777
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 465</span>
778
+
779
+ <span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span>
780
+ <span class='lbracket'>[</span><span class='id identifier rubyid_stock_price'>stock_price</span><span class='comma'>,</span> <span class='id identifier rubyid_volatility'>volatility</span><span class='comma'>,</span> <span class='id identifier rubyid_years_to_target_date'>years_to_target_date</span><span class='comma'>,</span> <span class='id identifier rubyid_interest_rate'>interest_rate</span><span class='comma'>,</span> <span class='id identifier rubyid_dividend_yield'>dividend_yield</span><span class='comma'>,</span> <span class='id identifier rubyid_model'>model</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</span>
781
+ <span class='kw'>end</span></pre>
782
+ </td>
783
+ </tr>
784
+ </table>
785
+ </div>
786
+
787
+ <div class="method_details ">
788
+ <h3 class="signature " id="validate!-instance_method">
789
+
790
+ #<strong>validate!</strong> &#x21d2; <tt>Object</tt>
791
+
792
+
793
+
794
+
795
+
796
+ </h3><div class="docstring">
797
+ <div class="discussion">
798
+
799
+
800
+ </div>
801
+ </div>
802
+ <div class="tags">
803
+
804
+ <p class="tag_title">Raises:</p>
805
+ <ul class="raise">
806
+
807
+ <li>
808
+
809
+
810
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
811
+
812
+
813
+
814
+ </li>
815
+
816
+ </ul>
817
+
818
+ </div><table class="source_code">
819
+ <tr>
820
+ <td>
821
+ <pre class="lines">
822
+
823
+
824
+ 448
825
+ 449
826
+ 450</pre>
827
+ </td>
828
+ <td>
829
+ <pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 448</span>
830
+
831
+ <span class='kw'>def</span> <span class='id identifier rubyid_validate!'>validate!</span>
832
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>model must be &#39;black-scholes&#39; or &#39;normal&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>black-scholes</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>normal</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
833
+ <span class='kw'>end</span></pre>
834
+ </td>
835
+ </tr>
836
+ </table>
837
+ </div>
838
+
839
+ </div>
840
+
841
+ </div>
842
+
843
+ <div id="footer">
844
+ Generated on Sun Apr 27 16:09:34 2025 by
845
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
846
+ 0.9.37 (ruby-3.3.3).
847
+ </div>
848
+
849
+ </div>
850
+ </body>
851
+ </html>