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.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +139 -0
- data/.yard/hooks/before_generate.rb +7 -0
- data/.yardopts +11 -0
- data/Gemfile +26 -0
- data/LICENSE.txt +21 -0
- data/README.md +180 -0
- data/Rakefile +44 -0
- data/docs/OptionLab/BinomialTree.html +1271 -0
- data/docs/OptionLab/BjerksundStensland.html +2022 -0
- data/docs/OptionLab/BlackScholes.html +2388 -0
- data/docs/OptionLab/Engine.html +1716 -0
- data/docs/OptionLab/Models/AmericanModelInputs.html +937 -0
- data/docs/OptionLab/Models/ArrayInputs.html +463 -0
- data/docs/OptionLab/Models/BaseModel.html +223 -0
- data/docs/OptionLab/Models/BinomialModelInputs.html +1161 -0
- data/docs/OptionLab/Models/BlackScholesInfo.html +967 -0
- data/docs/OptionLab/Models/BlackScholesModelInputs.html +851 -0
- data/docs/OptionLab/Models/ClosedPosition.html +445 -0
- data/docs/OptionLab/Models/EngineData.html +2523 -0
- data/docs/OptionLab/Models/EngineDataResults.html +435 -0
- data/docs/OptionLab/Models/Inputs.html +2241 -0
- data/docs/OptionLab/Models/LaplaceInputs.html +777 -0
- data/docs/OptionLab/Models/Option.html +736 -0
- data/docs/OptionLab/Models/Outputs.html +1753 -0
- data/docs/OptionLab/Models/PoPOutputs.html +645 -0
- data/docs/OptionLab/Models/PricingResult.html +848 -0
- data/docs/OptionLab/Models/Stock.html +583 -0
- data/docs/OptionLab/Models/TreeVisualization.html +688 -0
- data/docs/OptionLab/Models.html +251 -0
- data/docs/OptionLab/Plotting.html +548 -0
- data/docs/OptionLab/Support.html +2884 -0
- data/docs/OptionLab/Utils.html +619 -0
- data/docs/OptionLab.html +133 -0
- data/docs/_index.html +376 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/file.LICENSE.html +70 -0
- data/docs/file.README.html +263 -0
- data/docs/file_list.html +64 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +263 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +1974 -0
- data/docs/top-level-namespace.html +110 -0
- data/examples/american_options.rb +163 -0
- data/examples/covered_call.rb +76 -0
- data/lib/option_lab/binomial_tree.rb +238 -0
- data/lib/option_lab/bjerksund_stensland.rb +276 -0
- data/lib/option_lab/black_scholes.rb +323 -0
- data/lib/option_lab/engine.rb +492 -0
- data/lib/option_lab/models.rb +768 -0
- data/lib/option_lab/plotting.rb +182 -0
- data/lib/option_lab/support.rb +471 -0
- data/lib/option_lab/utils.rb +107 -0
- data/lib/option_lab/version.rb +5 -0
- data/lib/option_lab.rb +134 -0
- data/option_lab.gemspec +43 -0
- metadata +207 -0
@@ -0,0 +1,583 @@
|
|
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::Stock
|
8
|
+
|
9
|
+
— 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::Stock";
|
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 (S)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../OptionLab.html" title="OptionLab (module)">OptionLab</a></span></span> » <span class='title'><span class='object_link'><a href="../Models.html" title="OptionLab::Models (module)">Models</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Stock</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::Stock
|
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::Stock</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>Stock position model</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="#action-instance_method" title="#action (instance method)">#<strong>action</strong> ⇒ 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 action.</p>
|
142
|
+
</div></span>
|
143
|
+
|
144
|
+
</li>
|
145
|
+
|
146
|
+
|
147
|
+
<li class="public ">
|
148
|
+
<span class="summary_signature">
|
149
|
+
|
150
|
+
<a href="#n-instance_method" title="#n (instance method)">#<strong>n</strong> ⇒ 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 n.</p>
|
168
|
+
</div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#prev_pos-instance_method" title="#prev_pos (instance method)">#<strong>prev_pos</strong> ⇒ 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 prev_pos.</p>
|
194
|
+
</div></span>
|
195
|
+
|
196
|
+
</li>
|
197
|
+
|
198
|
+
|
199
|
+
<li class="public ">
|
200
|
+
<span class="summary_signature">
|
201
|
+
|
202
|
+
<a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> ⇒ Object </a>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
</span>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
<span class="note title readonly">readonly</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute type.</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
</ul>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<h2>
|
234
|
+
Instance Method Summary
|
235
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
236
|
+
</h2>
|
237
|
+
|
238
|
+
<ul class="summary">
|
239
|
+
|
240
|
+
<li class="public ">
|
241
|
+
<span class="summary_signature">
|
242
|
+
|
243
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(attributes = {}) ⇒ Stock </a>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
</span>
|
248
|
+
|
249
|
+
|
250
|
+
<span class="note title constructor">constructor</span>
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<span class="summary_desc"><div class='inline'><p>A new instance of Stock.</p>
|
260
|
+
</div></span>
|
261
|
+
|
262
|
+
</li>
|
263
|
+
|
264
|
+
|
265
|
+
<li class="public ">
|
266
|
+
<span class="summary_signature">
|
267
|
+
|
268
|
+
<a href="#validate!-instance_method" title="#validate! (instance method)">#<strong>validate!</strong> ⇒ Object </a>
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
</span>
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
283
|
+
|
284
|
+
</li>
|
285
|
+
|
286
|
+
|
287
|
+
</ul>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
<div id="constructor_details" class="method_details_list">
|
293
|
+
<h2>Constructor Details</h2>
|
294
|
+
|
295
|
+
<div class="method_details first">
|
296
|
+
<h3 class="signature first" id="initialize-instance_method">
|
297
|
+
|
298
|
+
#<strong>initialize</strong>(attributes = {}) ⇒ <tt><span class='object_link'><a href="" title="OptionLab::Models::Stock (class)">Stock</a></span></tt>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
</h3><div class="docstring">
|
305
|
+
<div class="discussion">
|
306
|
+
<p>Returns a new instance of Stock.</p>
|
307
|
+
|
308
|
+
|
309
|
+
</div>
|
310
|
+
</div>
|
311
|
+
<div class="tags">
|
312
|
+
|
313
|
+
|
314
|
+
</div><table class="source_code">
|
315
|
+
<tr>
|
316
|
+
<td>
|
317
|
+
<pre class="lines">
|
318
|
+
|
319
|
+
|
320
|
+
37
|
321
|
+
38
|
322
|
+
39
|
323
|
+
40</pre>
|
324
|
+
</td>
|
325
|
+
<td>
|
326
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 37</span>
|
327
|
+
|
328
|
+
<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>
|
329
|
+
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>stock</span><span class='tstring_end'>'</span></span>
|
330
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_attributes'>attributes</span><span class='rparen'>)</span>
|
331
|
+
<span class='kw'>end</span></pre>
|
332
|
+
</td>
|
333
|
+
</tr>
|
334
|
+
</table>
|
335
|
+
</div>
|
336
|
+
|
337
|
+
</div>
|
338
|
+
|
339
|
+
<div id="instance_attr_details" class="attr_details">
|
340
|
+
<h2>Instance Attribute Details</h2>
|
341
|
+
|
342
|
+
|
343
|
+
<span id="action=-instance_method"></span>
|
344
|
+
<div class="method_details first">
|
345
|
+
<h3 class="signature first" id="action-instance_method">
|
346
|
+
|
347
|
+
#<strong>action</strong> ⇒ <tt>Object</tt>
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
</h3><div class="docstring">
|
354
|
+
<div class="discussion">
|
355
|
+
<p>Returns the value of attribute action.</p>
|
356
|
+
|
357
|
+
|
358
|
+
</div>
|
359
|
+
</div>
|
360
|
+
<div class="tags">
|
361
|
+
|
362
|
+
|
363
|
+
</div><table class="source_code">
|
364
|
+
<tr>
|
365
|
+
<td>
|
366
|
+
<pre class="lines">
|
367
|
+
|
368
|
+
|
369
|
+
34
|
370
|
+
35
|
371
|
+
36</pre>
|
372
|
+
</td>
|
373
|
+
<td>
|
374
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 34</span>
|
375
|
+
|
376
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_action'>action</span>
|
377
|
+
<span class='ivar'>@action</span>
|
378
|
+
<span class='kw'>end</span></pre>
|
379
|
+
</td>
|
380
|
+
</tr>
|
381
|
+
</table>
|
382
|
+
</div>
|
383
|
+
|
384
|
+
|
385
|
+
<span id="n=-instance_method"></span>
|
386
|
+
<div class="method_details ">
|
387
|
+
<h3 class="signature " id="n-instance_method">
|
388
|
+
|
389
|
+
#<strong>n</strong> ⇒ <tt>Object</tt>
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
</h3><div class="docstring">
|
396
|
+
<div class="discussion">
|
397
|
+
<p>Returns the value of attribute n.</p>
|
398
|
+
|
399
|
+
|
400
|
+
</div>
|
401
|
+
</div>
|
402
|
+
<div class="tags">
|
403
|
+
|
404
|
+
|
405
|
+
</div><table class="source_code">
|
406
|
+
<tr>
|
407
|
+
<td>
|
408
|
+
<pre class="lines">
|
409
|
+
|
410
|
+
|
411
|
+
34
|
412
|
+
35
|
413
|
+
36</pre>
|
414
|
+
</td>
|
415
|
+
<td>
|
416
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 34</span>
|
417
|
+
|
418
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_n'>n</span>
|
419
|
+
<span class='ivar'>@n</span>
|
420
|
+
<span class='kw'>end</span></pre>
|
421
|
+
</td>
|
422
|
+
</tr>
|
423
|
+
</table>
|
424
|
+
</div>
|
425
|
+
|
426
|
+
|
427
|
+
<span id="prev_pos=-instance_method"></span>
|
428
|
+
<div class="method_details ">
|
429
|
+
<h3 class="signature " id="prev_pos-instance_method">
|
430
|
+
|
431
|
+
#<strong>prev_pos</strong> ⇒ <tt>Object</tt>
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
</h3><div class="docstring">
|
438
|
+
<div class="discussion">
|
439
|
+
<p>Returns the value of attribute prev_pos.</p>
|
440
|
+
|
441
|
+
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
<div class="tags">
|
445
|
+
|
446
|
+
|
447
|
+
</div><table class="source_code">
|
448
|
+
<tr>
|
449
|
+
<td>
|
450
|
+
<pre class="lines">
|
451
|
+
|
452
|
+
|
453
|
+
34
|
454
|
+
35
|
455
|
+
36</pre>
|
456
|
+
</td>
|
457
|
+
<td>
|
458
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 34</span>
|
459
|
+
|
460
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prev_pos'>prev_pos</span>
|
461
|
+
<span class='ivar'>@prev_pos</span>
|
462
|
+
<span class='kw'>end</span></pre>
|
463
|
+
</td>
|
464
|
+
</tr>
|
465
|
+
</table>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
|
469
|
+
<span id=""></span>
|
470
|
+
<div class="method_details ">
|
471
|
+
<h3 class="signature " id="type-instance_method">
|
472
|
+
|
473
|
+
#<strong>type</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
</h3><div class="docstring">
|
480
|
+
<div class="discussion">
|
481
|
+
<p>Returns the value of attribute type.</p>
|
482
|
+
|
483
|
+
|
484
|
+
</div>
|
485
|
+
</div>
|
486
|
+
<div class="tags">
|
487
|
+
|
488
|
+
|
489
|
+
</div><table class="source_code">
|
490
|
+
<tr>
|
491
|
+
<td>
|
492
|
+
<pre class="lines">
|
493
|
+
|
494
|
+
|
495
|
+
35
|
496
|
+
36
|
497
|
+
37</pre>
|
498
|
+
</td>
|
499
|
+
<td>
|
500
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 35</span>
|
501
|
+
|
502
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span>
|
503
|
+
<span class='ivar'>@type</span>
|
504
|
+
<span class='kw'>end</span></pre>
|
505
|
+
</td>
|
506
|
+
</tr>
|
507
|
+
</table>
|
508
|
+
</div>
|
509
|
+
|
510
|
+
</div>
|
511
|
+
|
512
|
+
|
513
|
+
<div id="instance_method_details" class="method_details_list">
|
514
|
+
<h2>Instance Method Details</h2>
|
515
|
+
|
516
|
+
|
517
|
+
<div class="method_details first">
|
518
|
+
<h3 class="signature first" id="validate!-instance_method">
|
519
|
+
|
520
|
+
#<strong>validate!</strong> ⇒ <tt>Object</tt>
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
</h3><div class="docstring">
|
527
|
+
<div class="discussion">
|
528
|
+
|
529
|
+
|
530
|
+
</div>
|
531
|
+
</div>
|
532
|
+
<div class="tags">
|
533
|
+
|
534
|
+
<p class="tag_title">Raises:</p>
|
535
|
+
<ul class="raise">
|
536
|
+
|
537
|
+
<li>
|
538
|
+
|
539
|
+
|
540
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
</li>
|
545
|
+
|
546
|
+
</ul>
|
547
|
+
|
548
|
+
</div><table class="source_code">
|
549
|
+
<tr>
|
550
|
+
<td>
|
551
|
+
<pre class="lines">
|
552
|
+
|
553
|
+
|
554
|
+
42
|
555
|
+
43
|
556
|
+
44
|
557
|
+
45</pre>
|
558
|
+
</td>
|
559
|
+
<td>
|
560
|
+
<pre class="code"><span class="info file"># File 'lib/option_lab/models.rb', line 42</span>
|
561
|
+
|
562
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_validate!'>validate!</span>
|
563
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>n must be positive</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Numeric</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_positive?'>positive?</span>
|
564
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>action must be 'buy' or 'sell'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='const'><span class='object_link'><a href="../Models.html#ACTION_TYPES-constant" title="OptionLab::Models::ACTION_TYPES (constant)">ACTION_TYPES</a></span></span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_action'>action</span><span class='rparen'>)</span>
|
565
|
+
<span class='kw'>end</span></pre>
|
566
|
+
</td>
|
567
|
+
</tr>
|
568
|
+
</table>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
</div>
|
572
|
+
|
573
|
+
</div>
|
574
|
+
|
575
|
+
<div id="footer">
|
576
|
+
Generated on Sun Apr 27 16:09:34 2025 by
|
577
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
578
|
+
0.9.37 (ruby-3.3.3).
|
579
|
+
</div>
|
580
|
+
|
581
|
+
</div>
|
582
|
+
</body>
|
583
|
+
</html>
|