minting 1.9.6 → 2.0.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 +4 -4
  2. data/README.md +244 -121
  3. data/Rakefile +17 -26
  4. data/bin/bench_check +2 -2
  5. data/doc/agents/api_review-2026-06-15.md +1 -1
  6. data/doc/agents/copilot-instructions.md +5 -5
  7. data/doc/agents/expired/copilot-instructions.md +2 -2
  8. data/doc/agents/expired/gemini_gem_evaluation.md +2 -2
  9. data/lib/minting/aliases.rb +22 -0
  10. data/lib/minting/currency/currency.rb +87 -12
  11. data/lib/minting/data/crypto-currencies.yaml +126 -0
  12. data/lib/minting/data/world-currencies.yaml +75 -23
  13. data/lib/minting/mint/i18n.rb +79 -29
  14. data/lib/minting/mint/mint.rb +1 -26
  15. data/lib/minting/mint/registry/crypto.rb +59 -0
  16. data/lib/minting/mint/registry/registration.rb +1 -2
  17. data/lib/minting/mint/registry/symbols.rb +37 -30
  18. data/lib/minting/mint/rounding.rb +10 -7
  19. data/lib/minting/mint.rb +1 -2
  20. data/lib/minting/money/allocation/allocation.rb +2 -2
  21. data/lib/minting/money/allocation/split.rb +1 -1
  22. data/lib/minting/money/arithmetics/operators.rb +10 -13
  23. data/lib/minting/money/clamp.rb +6 -6
  24. data/lib/minting/money/coercion.rb +1 -1
  25. data/lib/minting/money/comparable.rb +3 -3
  26. data/lib/minting/money/constructors.rb +3 -42
  27. data/lib/minting/money/conversion.rb +23 -18
  28. data/lib/minting/money/format/format.rb +100 -0
  29. data/lib/minting/money/format/formatter.rb +102 -0
  30. data/lib/minting/money/format/to_s.rb +34 -99
  31. data/lib/minting/money/format/validator.rb +34 -0
  32. data/lib/minting/money/money.rb +25 -13
  33. data/lib/minting/money/parse.rb +127 -0
  34. data/lib/minting/money/rounding.rb +27 -0
  35. data/lib/minting/version.rb +1 -1
  36. data/lib/minting.rb +17 -8
  37. metadata +9 -28
  38. data/doc/Mint/Currency.html +0 -1943
  39. data/doc/Mint/CurrencyRegistry.html +0 -511
  40. data/doc/Mint/Money.html +0 -4607
  41. data/doc/Mint/RangeStepPatch.html +0 -277
  42. data/doc/Mint/Registry.html +0 -863
  43. data/doc/Mint/Rounding.html +0 -506
  44. data/doc/Mint/UnknownCurrency.html +0 -136
  45. data/doc/Mint.html +0 -1004
  46. data/doc/Minting.html +0 -142
  47. data/doc/_index.html +0 -180
  48. data/doc/class_list.html +0 -54
  49. data/doc/css/common.css +0 -1
  50. data/doc/css/full_list.css +0 -206
  51. data/doc/css/style.css +0 -1089
  52. data/doc/file.README.html +0 -277
  53. data/doc/file_list.html +0 -59
  54. data/doc/frames.html +0 -22
  55. data/doc/index.html +0 -277
  56. data/doc/js/app.js +0 -801
  57. data/doc/js/full_list.js +0 -334
  58. data/doc/js/jquery.js +0 -4
  59. data/doc/method_list.html +0 -686
  60. data/doc/top-level-namespace.html +0 -151
  61. data/lib/minting/mint/aliases.rb +0 -16
  62. data/lib/minting/mint/parser/parser.rb +0 -97
  63. data/lib/minting/mint/parser/separators.rb +0 -41
  64. data/lib/minting/money/format/formatting.rb +0 -97
data/doc/Mint.html DELETED
@@ -1,1004 +0,0 @@
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
- Module: Mint
8
-
9
- &mdash; Documentation by YARD 0.9.44
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 = "Mint";
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 id="main_progress" aria-hidden="true"></div>
31
-
32
- <div class="nav_wrap">
33
- <iframe id="nav" src="class_list.html?1"></iframe>
34
- <div id="resizer"></div>
35
- </div>
36
-
37
- <div id="main" tabindex="-1">
38
- <div id="header">
39
- <div id="menu">
40
-
41
- <a href="_index.html">Index (M)</a> &raquo;
42
-
43
-
44
- <span class="title">Mint</span>
45
-
46
- </div>
47
-
48
- <div id="search">
49
-
50
- <a class="full_list_link" id="class_list_link"
51
- href="class_list.html">
52
-
53
- <svg width="24" height="24">
54
- <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
55
- <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
56
- <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
57
- </svg>
58
- </a>
59
-
60
- </div>
61
- <div class="clear"></div>
62
- </div>
63
-
64
- <div id="content"><h1>Module: Mint
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
-
72
-
73
-
74
- <dl>
75
- <dt>Extended by:</dt>
76
- <dd><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></dd>
77
- </dl>
78
-
79
-
80
-
81
-
82
-
83
-
84
- <dl>
85
- <dt>Included in:</dt>
86
- <dd><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></dd>
87
- </dl>
88
-
89
-
90
-
91
- <dl>
92
- <dt>Defined in:</dt>
93
- <dd>lib/minting/mint/i18n.rb<span class="defines">,<br>
94
- lib/minting/mint/mint.rb,<br> lib/minting/money/clamp.rb,<br> lib/minting/money/money.rb,<br> lib/minting/mint/rounding.rb,<br> lib/minting/mint/dsl/range.rb,<br> lib/minting/money/coercion.rb,<br> lib/minting/mint/dsl/string.rb,<br> lib/minting/mint/dsl/numeric.rb,<br> lib/minting/money/comparable.rb,<br> lib/minting/money/conversion.rb,<br> lib/minting/currency/currency.rb,<br> lib/minting/money/format/to_s.rb,<br> lib/minting/mint/dsl/top_level.rb,<br> lib/minting/mint/parser/parser.rb,<br> lib/minting/money/constructors.rb,<br> lib/minting/mint/registry/zeros.rb,<br> lib/minting/mint/registry/symbols.rb,<br> lib/minting/mint/parser/separators.rb,<br> lib/minting/mint/registry/registry.rb,<br> lib/minting/money/allocation/split.rb,<br> lib/minting/money/format/formatting.rb,<br> lib/minting/money/arithmetics/methods.rb,<br> lib/minting/mint/registry/registration.rb,<br> lib/minting/money/allocation/allocation.rb,<br> lib/minting/money/arithmetics/operators.rb</span>
95
-
96
- </dd>
97
- </dl>
98
-
99
- </div>
100
-
101
- <h2>Overview</h2><div class="docstring">
102
- <div class="discussion">
103
- <p>Mint registry: manages all cached state</p>
104
-
105
- </div>
106
- </div>
107
- <div class="tags">
108
-
109
-
110
- </div><h2>Defined Under Namespace</h2>
111
- <p class="children">
112
-
113
-
114
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="Mint/RangeStepPatch.html" title="Mint::RangeStepPatch (module)">RangeStepPatch</a></span>, <span class='object_link'><a href="Mint/Registry.html" title="Mint::Registry (module)">Registry</a></span>, <span class='object_link'><a href="Mint/Rounding.html" title="Mint::Rounding (module)">Rounding</a></span>
115
-
116
-
117
-
118
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span>, <span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span>, <span class='object_link'><a href="Mint/UnknownCurrency.html" title="Mint::UnknownCurrency (class)">UnknownCurrency</a></span>
119
-
120
-
121
- </p>
122
-
123
-
124
-
125
-
126
- <h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
127
- <ul class="summary">
128
-
129
- <li class="public ">
130
- <span class="summary_signature">
131
-
132
- <a href="#locale_backend-class_method" title="locale_backend (class method)">.<strong>locale_backend</strong> &#x21d2; Proc, ... </a>
133
-
134
-
135
-
136
- </span>
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
- <span class="summary_desc"><div class='inline'><p>Optional callable that returns a Hash with locale-aware formatting defaults.</p></div></span>
150
-
151
- </li>
152
-
153
-
154
- </ul>
155
-
156
-
157
-
158
-
159
-
160
- <h2>
161
- Class Method Summary
162
- <small><a href="#" class="summary_toggle">collapse</a></small>
163
- </h2>
164
-
165
- <ul class="summary">
166
-
167
- <li class="public ">
168
- <span class="summary_signature">
169
-
170
- <a href="#money-class_method" title="money (class method)">.<strong>money</strong>(amount, currency_code) &#x21d2; Money </a>
171
-
172
-
173
-
174
- </span>
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
-
184
- <span class="summary_desc"><div class='inline'><p>Creates a new <span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span> instance with the given amount and currency code.</p></div></span>
185
-
186
- </li>
187
-
188
-
189
- <li class="public ">
190
- <span class="summary_signature">
191
-
192
- <a href="#use_top_level_constants!-class_method" title="use_top_level_constants! (class method)">.<strong>use_top_level_constants!</strong> &#x21d2; Object </a>
193
-
194
-
195
-
196
- </span>
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
- <span class="summary_desc"><div class='inline'><p>Registers top-level ::Money and ::Currency constants as aliases for Mint's classes.</p></div></span>
207
-
208
- </li>
209
-
210
-
211
- <li class="public ">
212
- <span class="summary_signature">
213
-
214
- <a href="#with_rounding-class_method" title="with_rounding (class method)">.<strong>with_rounding</strong>(mode) { ... } &#x21d2; Object </a>
215
-
216
-
217
-
218
- </span>
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
- <span class="summary_desc"><div class='inline'><p>Executes a block with a specific rounding mode applied to all money construction, parsing, change, allocation, and split operations.</p></div></span>
229
-
230
- </li>
231
-
232
-
233
- <li class="public ">
234
- <span class="summary_signature">
235
-
236
- <a href="#world_currencies-class_method" title="world_currencies (class method)">.<strong>world_currencies</strong> &#x21d2; Hash{String =&gt; Currency} </a>
237
-
238
-
239
-
240
- </span>
241
-
242
-
243
-
244
-
245
-
246
-
247
- <span class="private note title">private</span>
248
-
249
-
250
- <span class="summary_desc"><div class='inline'><p>The frozen world-currencies hash.</p></div></span>
251
-
252
- </li>
253
-
254
-
255
- </ul>
256
-
257
-
258
- <h2>
259
- Instance Method Summary
260
- <small><a href="#" class="summary_toggle">collapse</a></small>
261
- </h2>
262
-
263
- <ul class="summary">
264
-
265
- <li class="public ">
266
- <span class="summary_signature">
267
-
268
- <a href="#parse-instance_method" title="#parse (instance method)">#<strong>parse</strong>(input, currency = nil) &#x21d2; Money<sup>?</sup> </a>
269
-
270
-
271
-
272
- </span>
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
-
282
- <span class="summary_desc"><div class='inline'><p>Parses a human-readable money string into a <span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span> object.</p></div></span>
283
-
284
- </li>
285
-
286
-
287
- <li class="public ">
288
- <span class="summary_signature">
289
-
290
- <a href="#parse!-instance_method" title="#parse! (instance method)">#<strong>parse!</strong>(input, currency = nil) &#x21d2; Money </a>
291
-
292
-
293
-
294
- </span>
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
- <span class="summary_desc"><div class='inline'><p>Like <span class='object_link'><a href="#parse-instance_method" title="Mint#parse (method)">#parse</a></span> but raises on failure.</p></div></span>
305
-
306
- </li>
307
-
308
-
309
- </ul>
310
-
311
-
312
-
313
-
314
- <div id="class_attr_details" class="attr_details">
315
- <h2>Class Attribute Details</h2>
316
-
317
-
318
- <span id="locale_backend=-class_method"></span>
319
- <div class="method_details first">
320
- <h3 class="signature first" id="locale_backend-class_method">
321
-
322
- .<strong>locale_backend</strong> &#x21d2; <tt>Proc</tt>, ...
323
-
324
-
325
-
326
-
327
-
328
- </h3><div class="docstring">
329
- <div class="discussion">
330
- <p>Optional callable that returns a Hash with locale-aware formatting defaults.</p>
331
- <p>The callable receives no arguments and returns a Hash with these keys:</p>
332
- <pre class="code ruby"><code class="ruby">[+:decimal+] Decimal separator (e.g. +&quot;,&quot;+)
333
- [+:thousand+] Thousands delimiter (e.g. +&quot;.&quot;+)
334
- [+:format+] Format template string (e.g. +&quot;%&lt;amount&gt;f %&lt;symbol&gt;s&quot;+)
335
- </code></pre>
336
- <p>When set, <code>#to_s</code> and <code>#format</code> use these values as fallbacks when the
337
- corresponding parameter is not explicitly provided.</p>
338
-
339
- </div>
340
- </div>
341
- <div class="tags">
342
-
343
- <div class="examples">
344
- <h4 class="tag_title">Examples:</h4>
345
-
346
-
347
- <h5 class="example_title"><div class='inline'><p>Rails I18n integration (in minting-rails railtie)</p></div></h5>
348
-
349
- <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_locale_backend'>locale_backend</span> <span class='op'>=</span> <span class='tlambda'>-&gt;</span> <span class='tlambeg'>{</span>
350
- <span class='id identifier rubyid_fmt'>fmt</span> <span class='op'>=</span> <span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>number.currency.format</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
351
- <span class='lbrace'>{</span>
352
- <span class='label'>decimal:</span> <span class='id identifier rubyid_fmt'>fmt</span><span class='lbracket'>[</span><span class='symbol'>:separator</span><span class='rbracket'>]</span><span class='comma'>,</span>
353
- <span class='label'>thousand:</span> <span class='id identifier rubyid_fmt'>fmt</span><span class='lbracket'>[</span><span class='symbol'>:delimiter</span><span class='rbracket'>]</span><span class='comma'>,</span>
354
- <span class='label'>format:</span> <span class='id identifier rubyid_fmt'>fmt</span><span class='lbracket'>[</span><span class='symbol'>:format</span><span class='rbracket'>]</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%n %u</span><span class='tstring_end'>&#39;</span></span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%&lt;amount&gt;f %&lt;symbol&gt;s</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%&lt;symbol&gt;s%&lt;amount&gt;f</span><span class='tstring_end'>&#39;</span></span>
355
- <span class='rbrace'>}</span>
356
- <span class='rbrace'>}</span></code></pre>
357
-
358
- </div>
359
-
360
- <p class="tag_title">Returns:</p>
361
- <ul class="return">
362
-
363
- <li>
364
-
365
-
366
- <span class='type'>(<tt>Proc</tt>, <tt>#call</tt>, <tt>nil</tt>)</span>
367
-
368
-
369
-
370
- </li>
371
-
372
- </ul>
373
-
374
- </div><table class="source_code">
375
- <tr>
376
- <td>
377
- <pre class="lines">
378
-
379
-
380
- 27
381
- 28
382
- 29</pre>
383
- </td>
384
- <td>
385
- <pre class="code"><span class="info file"># File 'lib/minting/mint/i18n.rb', line 27</span>
386
-
387
- <span class='kw'>def</span> <span class='id identifier rubyid_locale_backend'>locale_backend</span>
388
- <span class='ivar'>@locale_backend</span>
389
- <span class='kw'>end</span></pre>
390
- </td>
391
- </tr>
392
- </table>
393
- </div>
394
-
395
- </div>
396
-
397
-
398
- <div id="class_method_details" class="method_details_list">
399
- <h2>Class Method Details</h2>
400
-
401
-
402
- <div class="method_details first">
403
- <h3 class="signature first" id="money-class_method">
404
-
405
- .<strong>money</strong>(amount, currency_code) &#x21d2; <tt><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></tt>
406
-
407
-
408
-
409
-
410
-
411
- </h3><div class="docstring">
412
- <div class="discussion">
413
- <p>Creates a new <span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span> instance with the given amount and currency code.</p>
414
-
415
- </div>
416
- </div>
417
- <div class="tags">
418
- <p class="tag_title">Parameters:</p>
419
- <ul class="param">
420
-
421
- <li>
422
-
423
- <span class='name'>amount</span>
424
-
425
-
426
- <span class='type'>(<tt>Numeric</tt>)</span>
427
-
428
-
429
-
430
- &mdash;
431
- <div class='inline'><p>the financial value</p></div>
432
-
433
- </li>
434
-
435
- <li>
436
-
437
- <span class='name'>currency_code</span>
438
-
439
-
440
- <span class='type'>(<tt><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span></tt>, <tt>String</tt>)</span>
441
-
442
-
443
-
444
- &mdash;
445
- <div class='inline'><p>Currency code</p></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><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></tt>)</span>
458
-
459
-
460
-
461
- &mdash;
462
- <div class='inline'><p>the instantiated Money object</p></div>
463
-
464
- </li>
465
-
466
- </ul>
467
- <p class="tag_title">Raises:</p>
468
- <ul class="raise">
469
-
470
- <li>
471
-
472
-
473
- <span class='type'>(<tt>ArgumentError</tt>)</span>
474
-
475
-
476
-
477
- &mdash;
478
- <div class='inline'><p>if the currency code is not registered</p></div>
479
-
480
- </li>
481
-
482
- </ul>
483
-
484
- </div><table class="source_code">
485
- <tr>
486
- <td>
487
- <pre class="lines">
488
-
489
-
490
- 15</pre>
491
- </td>
492
- <td>
493
- <pre class="code"><span class="info file"># File 'lib/minting/mint/mint.rb', line 15</span>
494
-
495
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_money'>money</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='comma'>,</span> <span class='id identifier rubyid_currency_code'>currency_code</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></span><span class='period'>.</span><span class='id identifier rubyid_from'><span class='object_link'><a href="Mint/Money.html#from-class_method" title="Mint::Money.from (method)">from</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='comma'>,</span> <span class='id identifier rubyid_currency_code'>currency_code</span><span class='rparen'>)</span></pre>
496
- </td>
497
- </tr>
498
- </table>
499
- </div>
500
-
501
- <div class="method_details ">
502
- <h3 class="signature " id="use_top_level_constants!-class_method">
503
-
504
- .<strong>use_top_level_constants!</strong> &#x21d2; <tt>Object</tt>
505
-
506
-
507
-
508
-
509
-
510
- </h3><div class="docstring">
511
- <div class="discussion">
512
- <p>Registers top-level ::Money and ::Currency constants as aliases for Mint's classes.</p>
513
-
514
- </div>
515
- </div>
516
- <div class="tags">
517
-
518
- <p class="tag_title">Raises:</p>
519
- <ul class="raise">
520
-
521
- <li>
522
-
523
-
524
- <span class='type'>(<tt>NameError</tt>)</span>
525
-
526
-
527
-
528
- &mdash;
529
- <div class='inline'><p>if ::Money or ::Currency are already defined and differ</p></div>
530
-
531
- </li>
532
-
533
- </ul>
534
-
535
- </div><table class="source_code">
536
- <tr>
537
- <td>
538
- <pre class="lines">
539
-
540
-
541
- 8
542
- 9
543
- 10
544
- 11
545
- 12
546
- 13
547
- 14
548
- 15
549
- 16</pre>
550
- </td>
551
- <td>
552
- <pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/top_level.rb', line 8</span>
553
-
554
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_use_top_level_constants!'>use_top_level_constants!</span>
555
- <span class='kw'>if</span> <span class='op'>!</span><span class='kw'>defined?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='op'>!</span><span class='kw'>defined?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#Currency-constant" title="Currency (constant)">Currency</a></span></span><span class='rparen'>)</span>
556
- <span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>minting/mint/aliases</span><span class='tstring_end'>&#39;</span></span>
557
- <span class='kw'>elsif</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></span> <span class='op'>==</span> <span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></span> <span class='op'>&amp;&amp;</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#Currency-constant" title="Currency (constant)">Currency</a></span></span> <span class='op'>==</span> <span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span></span>
558
- <span class='id identifier rubyid_warn'>warn</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Warning: Money and Currency already defined as Mint aliases, skipping</span><span class='tstring_end'>&#39;</span></span>
559
- <span class='kw'>else</span>
560
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NameError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Cannot define top-level Money or Currency constants: already defined</span><span class='tstring_end'>&#39;</span></span>
561
- <span class='kw'>end</span>
562
- <span class='kw'>end</span></pre>
563
- </td>
564
- </tr>
565
- </table>
566
- </div>
567
-
568
- <div class="method_details ">
569
- <h3 class="signature " id="with_rounding-class_method">
570
-
571
- .<strong>with_rounding</strong>(mode) { ... } &#x21d2; <tt>Object</tt>
572
-
573
-
574
-
575
-
576
-
577
- </h3><div class="docstring">
578
- <div class="discussion">
579
- <p>Executes a block with a specific rounding mode applied to all money
580
- construction, parsing, change, allocation, and split operations.</p>
581
- <p>Restores the previous mode (or default) when the block exits, even on
582
- exception.</p>
583
- <p>Rounding-mode support is loaded lazily on first call. Once loaded,
584
- <code>Currency#normalize_amount</code> is patched to dispatch through the
585
- rounding module, adding ~10–35&amp;ns of overhead to every money creation
586
- or mutation. When rounding modes are never used (the common case),
587
- the fast path incurs zero overhead.</p>
588
-
589
- </div>
590
- </div>
591
- <div class="tags">
592
- <p class="tag_title">Parameters:</p>
593
- <ul class="param">
594
-
595
- <li>
596
-
597
- <span class='name'>mode</span>
598
-
599
-
600
- <span class='type'>(<tt>Symbol</tt>)</span>
601
-
602
-
603
-
604
- &mdash;
605
- <div class='inline'><p>one of: <code>:half_up</code>, <code>:half_down</code>, <code>:floor</code>,
606
- <code>:ceil</code>, <code>:truncate</code>, <code>:down</code></p></div>
607
-
608
- </li>
609
-
610
- </ul>
611
-
612
- <p class="tag_title">Yields:</p>
613
- <ul class="yield">
614
-
615
- <li>
616
-
617
-
618
- <span class='type'></span>
619
-
620
-
621
-
622
-
623
- <div class='inline'><p>block to execute with the rounding mode active</p></div>
624
-
625
- </li>
626
-
627
- </ul>
628
- <p class="tag_title">Raises:</p>
629
- <ul class="raise">
630
-
631
- <li>
632
-
633
-
634
- <span class='type'>(<tt>ArgumentError</tt>)</span>
635
-
636
-
637
-
638
- &mdash;
639
- <div class='inline'><p>if <code>mode</code> is not a recognised rounding mode</p></div>
640
-
641
- </li>
642
-
643
- </ul>
644
-
645
- </div><table class="source_code">
646
- <tr>
647
- <td>
648
- <pre class="lines">
649
-
650
-
651
- 37
652
- 38
653
- 39
654
- 40</pre>
655
- </td>
656
- <td>
657
- <pre class="code"><span class="info file"># File 'lib/minting/mint/mint.rb', line 37</span>
658
-
659
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_with_rounding'>with_rounding</span><span class='lparen'>(</span><span class='id identifier rubyid_mode'>mode</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='rparen'>)</span>
660
- <span class='id identifier rubyid_require_relative'>require_relative</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>rounding</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mint/Rounding.html" title="Mint::Rounding (module)">Rounding</a></span></span><span class='rparen'>)</span>
661
- <span class='const'><span class='object_link'><a href="Mint/Rounding.html" title="Mint::Rounding (module)">Rounding</a></span></span><span class='period'>.</span><span class='id identifier rubyid_with_mode'><span class='object_link'><a href="Mint/Rounding.html#with_mode-class_method" title="Mint::Rounding.with_mode (method)">with_mode</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_mode'>mode</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='rparen'>)</span>
662
- <span class='kw'>end</span></pre>
663
- </td>
664
- </tr>
665
- </table>
666
- </div>
667
-
668
- <div class="method_details ">
669
- <h3 class="signature " id="world_currencies-class_method">
670
-
671
- .<strong>world_currencies</strong> &#x21d2; <tt>Hash{String =&gt; <span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span>}</tt>
672
-
673
-
674
-
675
-
676
-
677
- </h3><div class="docstring">
678
- <div class="discussion">
679
- <p class="note private">
680
- <strong>This method is part of a private API.</strong>
681
- You should avoid using this method if possible, as it may be removed or be changed in the future.
682
- </p>
683
- <p>Returns the frozen world-currencies hash.</p>
684
-
685
- </div>
686
- </div>
687
- <div class="tags">
688
-
689
- <p class="tag_title">Returns:</p>
690
- <ul class="return">
691
-
692
- <li>
693
-
694
-
695
- <span class='type'>(<tt>Hash{String =&gt; <span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span>}</tt>)</span>
696
-
697
-
698
-
699
- &mdash;
700
- <div class='inline'><p>the frozen world-currencies hash</p></div>
701
-
702
- </li>
703
-
704
- </ul>
705
-
706
- </div><table class="source_code">
707
- <tr>
708
- <td>
709
- <pre class="lines">
710
-
711
-
712
- 19</pre>
713
- </td>
714
- <td>
715
- <pre class="code"><span class="info file"># File 'lib/minting/mint/mint.rb', line 19</span>
716
-
717
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_world_currencies'>world_currencies</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Mint/Registry.html" title="Mint::Registry (module)">Registry</a></span></span><span class='period'>.</span><span class='id identifier rubyid_world_currencies'><span class='object_link'><a href="Mint/Registry.html#world_currencies-class_method" title="Mint::Registry.world_currencies (method)">world_currencies</a></span></span></pre>
718
- </td>
719
- </tr>
720
- </table>
721
- </div>
722
-
723
- </div>
724
-
725
- <div id="instance_method_details" class="method_details_list">
726
- <h2>Instance Method Details</h2>
727
-
728
-
729
- <div class="method_details first">
730
- <h3 class="signature first" id="parse-instance_method">
731
-
732
- #<strong>parse</strong>(input, currency = nil) &#x21d2; <tt><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></tt><sup>?</sup>
733
-
734
-
735
-
736
-
737
-
738
- </h3><div class="docstring">
739
- <div class="discussion">
740
- <p>Parses a human-readable money string into a <span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span> object.</p>
741
- <p>Returns <code>nil</code> when the input is invalid or currency cannot be determined.</p>
742
-
743
- </div>
744
- </div>
745
- <div class="tags">
746
-
747
- <div class="examples">
748
- <h4 class="tag_title">Examples:</h4>
749
-
750
-
751
- <h5 class="example_title"><div class='inline'><p>With explicit currency</p></div></h5>
752
-
753
- <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>19.99</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'>USD</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; [USD 19.99]
754
- </span><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>garbage</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'>USD</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; nil</span></code></pre>
755
-
756
-
757
- <h5 class="example_title"><div class='inline'><p>With symbol or code in the string</p></div></h5>
758
-
759
- <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>$19.99</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; [USD 19.99]
760
- </span><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>USD 1,234.56</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; [USD 1234.56]</span></code></pre>
761
-
762
- </div>
763
- <p class="tag_title">Parameters:</p>
764
- <ul class="param">
765
-
766
- <li>
767
-
768
- <span class='name'>input</span>
769
-
770
-
771
- <span class='type'>(<tt>String</tt>)</span>
772
-
773
-
774
-
775
- &mdash;
776
- <div class='inline'><p>Amount input, optionally including a currency symbol or code</p></div>
777
-
778
- </li>
779
-
780
- <li>
781
-
782
- <span class='name'>currency</span>
783
-
784
-
785
- <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span></tt>, <tt>nil</tt>)</span>
786
-
787
-
788
- <em class="default">(defaults to: <tt>nil</tt>)</em>
789
-
790
-
791
- &mdash;
792
- <div class='inline'><p>ISO code when not present in <code>input</code></p></div>
793
-
794
- </li>
795
-
796
- </ul>
797
-
798
- <p class="tag_title">Returns:</p>
799
- <ul class="return">
800
-
801
- <li>
802
-
803
-
804
- <span class='type'>(<tt><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></tt>, <tt>nil</tt>)</span>
805
-
806
-
807
-
808
- </li>
809
-
810
- </ul>
811
-
812
- </div><table class="source_code">
813
- <tr>
814
- <td>
815
- <pre class="lines">
816
-
817
-
818
- 22
819
- 23
820
- 24
821
- 25
822
- 26
823
- 27
824
- 28
825
- 29
826
- 30
827
- 31
828
- 32
829
- 33
830
- 34
831
- 35
832
- 36</pre>
833
- </td>
834
- <td>
835
- <pre class="code"><span class="info file"># File 'lib/minting/mint/parser/parser.rb', line 22</span>
836
-
837
- <span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
838
- <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
839
-
840
- <span class='id identifier rubyid_input'>input</span> <span class='op'>=</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
841
- <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
842
-
843
- <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_currency'>parse_currency</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
844
- <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_currency'>currency</span>
845
-
846
- <span class='id identifier rubyid_amount'>amount</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_amount'>parse_amount</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
847
- <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_amount'>amount</span>
848
-
849
- <span class='id identifier rubyid_amount'>amount</span> <span class='op'>=</span> <span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_normalize_amount'>normalize_amount</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='rparen'>)</span>
850
- <span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
851
- <span class='kw'>end</span></pre>
852
- </td>
853
- </tr>
854
- </table>
855
- </div>
856
-
857
- <div class="method_details ">
858
- <h3 class="signature " id="parse!-instance_method">
859
-
860
- #<strong>parse!</strong>(input, currency = nil) &#x21d2; <tt><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></tt>
861
-
862
-
863
-
864
-
865
-
866
- </h3><div class="docstring">
867
- <div class="discussion">
868
- <p>Like <span class='object_link'><a href="#parse-instance_method" title="Mint#parse (method)">#parse</a></span> but raises on failure.</p>
869
-
870
- </div>
871
- </div>
872
- <div class="tags">
873
-
874
- <div class="examples">
875
- <h4 class="tag_title">Examples:</h4>
876
-
877
-
878
- <pre class="example code"><code><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>19.99</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'>USD</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; [USD 19.99]
879
- </span><span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>garbage</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'>USD</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; ArgumentError</span></code></pre>
880
-
881
- </div>
882
- <p class="tag_title">Parameters:</p>
883
- <ul class="param">
884
-
885
- <li>
886
-
887
- <span class='name'>input</span>
888
-
889
-
890
- <span class='type'>(<tt>String</tt>)</span>
891
-
892
-
893
-
894
- &mdash;
895
- <div class='inline'><p>Amount input, optionally including a currency symbol or code</p></div>
896
-
897
- </li>
898
-
899
- <li>
900
-
901
- <span class='name'>currency</span>
902
-
903
-
904
- <span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span></tt>, <tt>nil</tt>)</span>
905
-
906
-
907
- <em class="default">(defaults to: <tt>nil</tt>)</em>
908
-
909
-
910
- &mdash;
911
- <div class='inline'><p>ISO code when not present in <code>input</code></p></div>
912
-
913
- </li>
914
-
915
- </ul>
916
-
917
- <p class="tag_title">Returns:</p>
918
- <ul class="return">
919
-
920
- <li>
921
-
922
-
923
- <span class='type'>(<tt><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></tt>)</span>
924
-
925
-
926
-
927
- </li>
928
-
929
- </ul>
930
- <p class="tag_title">Raises:</p>
931
- <ul class="raise">
932
-
933
- <li>
934
-
935
-
936
- <span class='type'>(<tt>ArgumentError</tt>)</span>
937
-
938
-
939
-
940
- &mdash;
941
- <div class='inline'><p>when <code>input</code> is invalid or currency cannot be determined</p></div>
942
-
943
- </li>
944
-
945
- </ul>
946
-
947
- </div><table class="source_code">
948
- <tr>
949
- <td>
950
- <pre class="lines">
951
-
952
-
953
- 48
954
- 49
955
- 50
956
- 51
957
- 52
958
- 53
959
- 54
960
- 55
961
- 56
962
- 57
963
- 58
964
- 59
965
- 60
966
- 61
967
- 62</pre>
968
- </td>
969
- <td>
970
- <pre class="code"><span class="info file"># File 'lib/minting/mint/parser/parser.rb', line 48</span>
971
-
972
- <span class='kw'>def</span> <span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
973
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>input must be a String</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
974
-
975
- <span class='id identifier rubyid_input'>input</span> <span class='op'>=</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span>
976
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>input cannot be empty</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
977
-
978
- <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_currency'>parse_currency</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
979
- <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'>Currency [</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_currency'>currency</span><span class='embexpr_end'>}</span><span class='tstring_content'>] not found</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_currency'>currency</span>
980
-
981
- <span class='id identifier rubyid_amount'>amount</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_amount'>parse_amount</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
982
- <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'>Could not parse [</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_input'>input</span><span class='embexpr_end'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_amount'>amount</span>
983
-
984
- <span class='id identifier rubyid_amount'>amount</span> <span class='op'>=</span> <span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_normalize_amount'>normalize_amount</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='rparen'>)</span>
985
- <span class='const'><span class='object_link'><a href="" title="Mint (module)">Mint</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_amount'>amount</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
986
- <span class='kw'>end</span></pre>
987
- </td>
988
- </tr>
989
- </table>
990
- </div>
991
-
992
- </div>
993
-
994
- </div>
995
-
996
- <div id="footer">
997
- Generated on Mon Jun 22 16:47:02 2026 by
998
- <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
999
- 0.9.44 (ruby-4.0.5).
1000
- </div>
1001
-
1002
- </div>
1003
- </body>
1004
- </html>