minting 1.9.7 → 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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +234 -116
  3. data/Rakefile +2 -7
  4. data/doc/agents/api_review-2026-06-15.md +1 -1
  5. data/doc/agents/copilot-instructions.md +2 -2
  6. data/doc/agents/expired/copilot-instructions.md +2 -2
  7. data/doc/agents/expired/gemini_gem_evaluation.md +2 -2
  8. data/lib/minting/aliases.rb +22 -0
  9. data/lib/minting/currency/currency.rb +81 -9
  10. data/lib/minting/data/crypto-currencies.yaml +126 -0
  11. data/lib/minting/mint/i18n.rb +79 -29
  12. data/lib/minting/mint/mint.rb +1 -26
  13. data/lib/minting/mint/registry/crypto.rb +59 -0
  14. data/lib/minting/mint/registry/registration.rb +1 -2
  15. data/lib/minting/mint/registry/symbols.rb +37 -30
  16. data/lib/minting/mint/rounding.rb +9 -7
  17. data/lib/minting/mint.rb +1 -2
  18. data/lib/minting/money/allocation/allocation.rb +2 -2
  19. data/lib/minting/money/allocation/split.rb +1 -1
  20. data/lib/minting/money/arithmetics/operators.rb +10 -13
  21. data/lib/minting/money/clamp.rb +6 -6
  22. data/lib/minting/money/coercion.rb +1 -1
  23. data/lib/minting/money/comparable.rb +3 -3
  24. data/lib/minting/money/constructors.rb +3 -42
  25. data/lib/minting/money/conversion.rb +22 -18
  26. data/lib/minting/money/format/format.rb +100 -0
  27. data/lib/minting/money/format/formatter.rb +102 -0
  28. data/lib/minting/money/format/to_s.rb +20 -102
  29. data/lib/minting/money/format/validator.rb +34 -0
  30. data/lib/minting/money/money.rb +25 -9
  31. data/lib/minting/money/parse.rb +127 -0
  32. data/lib/minting/money/rounding.rb +27 -0
  33. data/lib/minting/version.rb +1 -1
  34. data/lib/minting.rb +17 -8
  35. metadata +9 -29
  36. data/doc/Mint/Currency.html +0 -2032
  37. data/doc/Mint/Money.html +0 -5139
  38. data/doc/Mint/RangeStepPatch.html +0 -277
  39. data/doc/Mint/Registry.html +0 -863
  40. data/doc/Mint/Rounding.html +0 -506
  41. data/doc/Mint/UnknownCurrency.html +0 -138
  42. data/doc/Mint.html +0 -931
  43. data/doc/Minting.html +0 -142
  44. data/doc/Numeric.html +0 -479
  45. data/doc/String.html +0 -241
  46. data/doc/_index.html +0 -206
  47. data/doc/class_list.html +0 -54
  48. data/doc/css/common.css +0 -1
  49. data/doc/css/full_list.css +0 -206
  50. data/doc/css/style.css +0 -1089
  51. data/doc/file.README.html +0 -291
  52. data/doc/file_list.html +0 -59
  53. data/doc/frames.html +0 -22
  54. data/doc/index.html +0 -291
  55. data/doc/js/app.js +0 -801
  56. data/doc/js/full_list.js +0 -334
  57. data/doc/js/jquery.js +0 -4
  58. data/doc/method_list.html +0 -758
  59. data/doc/top-level-namespace.html +0 -135
  60. data/lib/minting/mint/aliases.rb +0 -16
  61. data/lib/minting/mint/parser/parser.rb +0 -97
  62. data/lib/minting/mint/parser/separators.rb +0 -41
  63. data/lib/minting/money/format/formatting.rb +0 -130
data/doc/Minting.html DELETED
@@ -1,142 +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: Minting
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 = "Minting";
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">Minting</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: Minting
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
- <dl>
82
- <dt>Defined in:</dt>
83
- <dd>lib/minting/version.rb
84
- </dd>
85
- </dl>
86
-
87
- </div>
88
-
89
- <h2>Overview</h2><div class="docstring">
90
- <div class="discussion">
91
- <p>Root namespace for the Minting library.</p>
92
-
93
- </div>
94
- </div>
95
- <div class="tags">
96
-
97
-
98
- </div>
99
-
100
- <h2>
101
- Constant Summary
102
- <small><a href="#" class="constants_summary_toggle">collapse</a></small>
103
- </h2>
104
-
105
- <dl class="constants">
106
-
107
- <dt id="VERSION-constant" class="">VERSION =
108
- <div class="docstring">
109
- <div class="discussion">
110
- <p>Current version of the Minting gem.</p>
111
-
112
- </div>
113
- </div>
114
- <div class="tags">
115
-
116
-
117
- </div>
118
- </dt>
119
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.9.6</span><span class='tstring_end'>&#39;</span></span></pre></dd>
120
-
121
- </dl>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
- </div>
133
-
134
- <div id="footer">
135
- Generated on Wed Jul 1 01:11:52 2026 by
136
- <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
137
- 0.9.44 (ruby-4.0.5).
138
- </div>
139
-
140
- </div>
141
- </body>
142
- </html>
data/doc/Numeric.html DELETED
@@ -1,479 +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
- Class: Numeric
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 = "Numeric";
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 (N)</a> &raquo;
42
-
43
-
44
- <span class="title">Numeric</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>Class: Numeric
65
-
66
-
67
-
68
- </h1>
69
- <div class="box_info">
70
-
71
- <dl>
72
- <dt>Inherits:</dt>
73
- <dd>
74
- <span class="inheritName">Object</span>
75
-
76
- <ul class="fullTree">
77
- <li>Object</li>
78
-
79
- <li class="next">Numeric</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/minting/mint/dsl/numeric.rb
100
- </dd>
101
- </dl>
102
-
103
- </div>
104
-
105
- <h2>Overview</h2><div class="docstring">
106
- <div class="discussion">
107
- <p>Core extension: adds money-conversion helpers to Numeric.</p>
108
-
109
- </div>
110
- </div>
111
- <div class="tags">
112
-
113
-
114
- </div>
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
- <h2>
123
- Instance Method Summary
124
- <small><a href="#" class="summary_toggle">collapse</a></small>
125
- </h2>
126
-
127
- <ul class="summary">
128
-
129
- <li class="public ">
130
- <span class="summary_signature">
131
-
132
- <a href="#dollars-instance_method" title="#dollars (instance method)">#<strong>dollars</strong> &#x21d2; Money </a>
133
-
134
-
135
-
136
- (also: #dollar)
137
-
138
- </span>
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
- <span class="summary_desc"><div class='inline'><p>Self interpreted as USD.</p></div></span>
149
-
150
- </li>
151
-
152
-
153
- <li class="public ">
154
- <span class="summary_signature">
155
-
156
- <a href="#euros-instance_method" title="#euros (instance method)">#<strong>euros</strong> &#x21d2; Money </a>
157
-
158
-
159
-
160
- (also: #euro)
161
-
162
- </span>
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
- <span class="summary_desc"><div class='inline'><p>Self interpreted as EUR.</p></div></span>
173
-
174
- </li>
175
-
176
-
177
- <li class="public ">
178
- <span class="summary_signature">
179
-
180
- <a href="#reais-instance_method" title="#reais (instance method)">#<strong>reais</strong> &#x21d2; Money </a>
181
-
182
-
183
-
184
- </span>
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
-
194
- <span class="summary_desc"><div class='inline'><p>Self interpreted as BRL.</p></div></span>
195
-
196
- </li>
197
-
198
-
199
- <li class="public ">
200
- <span class="summary_signature">
201
-
202
- <a href="#to_money-instance_method" title="#to_money (instance method)">#<strong>to_money</strong>(currency) &#x21d2; Money </a>
203
-
204
-
205
-
206
- (also: #mint)
207
-
208
- </span>
209
-
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
- <span class="summary_desc"><div class='inline'><p>Self interpreted as the given currency.</p></div></span>
219
-
220
- </li>
221
-
222
-
223
- </ul>
224
-
225
-
226
-
227
-
228
-
229
- <div id="instance_method_details" class="method_details_list">
230
- <h2>Instance Method Details</h2>
231
-
232
-
233
- <div class="method_details first">
234
- <h3 class="signature first" id="dollars-instance_method">
235
-
236
- #<strong>dollars</strong> &#x21d2; <tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>
237
-
238
-
239
-
240
- <span class="aliases">Also known as:
241
- <span class="names"><span id='dollar-instance_method'>dollar</span></span>
242
- </span>
243
-
244
-
245
-
246
- </h3><div class="docstring">
247
- <div class="discussion">
248
- <p>Returns self interpreted as USD.</p>
249
-
250
- </div>
251
- </div>
252
- <div class="tags">
253
-
254
- <p class="tag_title">Returns:</p>
255
- <ul class="return">
256
-
257
- <li>
258
-
259
-
260
- <span class='type'>(<tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>)</span>
261
-
262
-
263
-
264
- &mdash;
265
- <div class='inline'><p>self interpreted as USD</p></div>
266
-
267
- </li>
268
-
269
- </ul>
270
-
271
- </div><table class="source_code">
272
- <tr>
273
- <td>
274
- <pre class="lines">
275
-
276
-
277
- 9</pre>
278
- </td>
279
- <td>
280
- <pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/numeric.rb', line 9</span>
281
-
282
- <span class='kw'>def</span> <span class='id identifier rubyid_dollars'>dollars</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Mint.html" 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_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='kw'>self</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></pre>
283
- </td>
284
- </tr>
285
- </table>
286
- </div>
287
-
288
- <div class="method_details ">
289
- <h3 class="signature " id="euros-instance_method">
290
-
291
- #<strong>euros</strong> &#x21d2; <tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>
292
-
293
-
294
-
295
- <span class="aliases">Also known as:
296
- <span class="names"><span id='euro-instance_method'>euro</span></span>
297
- </span>
298
-
299
-
300
-
301
- </h3><div class="docstring">
302
- <div class="discussion">
303
- <p>Returns self interpreted as EUR.</p>
304
-
305
- </div>
306
- </div>
307
- <div class="tags">
308
-
309
- <p class="tag_title">Returns:</p>
310
- <ul class="return">
311
-
312
- <li>
313
-
314
-
315
- <span class='type'>(<tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>)</span>
316
-
317
-
318
-
319
- &mdash;
320
- <div class='inline'><p>self interpreted as EUR</p></div>
321
-
322
- </li>
323
-
324
- </ul>
325
-
326
- </div><table class="source_code">
327
- <tr>
328
- <td>
329
- <pre class="lines">
330
-
331
-
332
- 12</pre>
333
- </td>
334
- <td>
335
- <pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/numeric.rb', line 12</span>
336
-
337
- <span class='kw'>def</span> <span class='id identifier rubyid_euros'>euros</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Mint.html" 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_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='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>EUR</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span></pre>
338
- </td>
339
- </tr>
340
- </table>
341
- </div>
342
-
343
- <div class="method_details ">
344
- <h3 class="signature " id="reais-instance_method">
345
-
346
- #<strong>reais</strong> &#x21d2; <tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>
347
-
348
-
349
-
350
-
351
-
352
- </h3><div class="docstring">
353
- <div class="discussion">
354
- <p>Returns self interpreted as BRL.</p>
355
-
356
- </div>
357
- </div>
358
- <div class="tags">
359
-
360
- <p class="tag_title">Returns:</p>
361
- <ul class="return">
362
-
363
- <li>
364
-
365
-
366
- <span class='type'>(<tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>)</span>
367
-
368
-
369
-
370
- &mdash;
371
- <div class='inline'><p>self interpreted as BRL</p></div>
372
-
373
- </li>
374
-
375
- </ul>
376
-
377
- </div><table class="source_code">
378
- <tr>
379
- <td>
380
- <pre class="lines">
381
-
382
-
383
- 6</pre>
384
- </td>
385
- <td>
386
- <pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/numeric.rb', line 6</span>
387
-
388
- <span class='kw'>def</span> <span class='id identifier rubyid_reais'>reais</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Mint.html" 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_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='kw'>self</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>BRL</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span></pre>
389
- </td>
390
- </tr>
391
- </table>
392
- </div>
393
-
394
- <div class="method_details ">
395
- <h3 class="signature " id="to_money-instance_method">
396
-
397
- #<strong>to_money</strong>(currency) &#x21d2; <tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>
398
-
399
-
400
-
401
- <span class="aliases">Also known as:
402
- <span class="names"><span id='mint-instance_method'>mint</span></span>
403
- </span>
404
-
405
-
406
-
407
- </h3><div class="docstring">
408
- <div class="discussion">
409
- <p>Returns self interpreted as the given currency.</p>
410
-
411
- </div>
412
- </div>
413
- <div class="tags">
414
- <p class="tag_title">Parameters:</p>
415
- <ul class="param">
416
-
417
- <li>
418
-
419
- <span class='name'>currency</span>
420
-
421
-
422
- <span class='type'>(<tt><span class='object_link'><a href="String.html" title="String (class)">String</a></span></tt>, <tt>Symbol</tt>, <tt><span class='object_link'><a href="top-level-namespace.html#Currency-constant" title="Currency (constant)">Currency</a></span></tt>)</span>
423
-
424
-
425
-
426
- &mdash;
427
- <div class='inline'><p>target currency</p></div>
428
-
429
- </li>
430
-
431
- </ul>
432
-
433
- <p class="tag_title">Returns:</p>
434
- <ul class="return">
435
-
436
- <li>
437
-
438
-
439
- <span class='type'>(<tt><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></tt>)</span>
440
-
441
-
442
-
443
- &mdash;
444
- <div class='inline'><p>self interpreted as the given currency</p></div>
445
-
446
- </li>
447
-
448
- </ul>
449
-
450
- </div><table class="source_code">
451
- <tr>
452
- <td>
453
- <pre class="lines">
454
-
455
-
456
- 16</pre>
457
- </td>
458
- <td>
459
- <pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/numeric.rb', line 16</span>
460
-
461
- <span class='kw'>def</span> <span class='id identifier rubyid_to_money'>to_money</span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Mint.html" 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_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='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span></pre>
462
- </td>
463
- </tr>
464
- </table>
465
- </div>
466
-
467
- </div>
468
-
469
- </div>
470
-
471
- <div id="footer">
472
- Generated on Wed Jul 1 01:11:53 2026 by
473
- <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
474
- 0.9.44 (ruby-4.0.5).
475
- </div>
476
-
477
- </div>
478
- </body>
479
- </html>