minting 1.9.6 → 1.9.7
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 +4 -4
- data/README.md +30 -25
- data/Rakefile +16 -20
- data/bin/bench_check +2 -2
- data/doc/Mint/Currency.html +183 -94
- data/doc/Mint/Money.html +866 -334
- data/doc/Mint/RangeStepPatch.html +1 -1
- data/doc/Mint/Registry.html +10 -10
- data/doc/Mint/Rounding.html +2 -2
- data/doc/Mint/UnknownCurrency.html +6 -4
- data/doc/Mint.html +33 -106
- data/doc/Minting.html +2 -2
- data/doc/Numeric.html +479 -0
- data/doc/String.html +241 -0
- data/doc/_index.html +27 -1
- data/doc/agents/copilot-instructions.md +3 -3
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +47 -33
- data/doc/index.html +47 -33
- data/doc/method_list.html +125 -53
- data/doc/top-level-namespace.html +5 -21
- data/lib/minting/currency/currency.rb +6 -3
- data/lib/minting/data/world-currencies.yaml +75 -23
- data/lib/minting/mint/i18n.rb +1 -1
- data/lib/minting/mint/rounding.rb +1 -0
- data/lib/minting/money/conversion.rb +1 -0
- data/lib/minting/money/format/formatting.rb +88 -55
- data/lib/minting/money/format/to_s.rb +20 -3
- data/lib/minting/money/money.rb +0 -4
- data/lib/minting/version.rb +1 -1
- metadata +3 -2
- data/doc/Mint/CurrencyRegistry.html +0 -511
data/doc/method_list.html
CHANGED
|
@@ -136,6 +136,14 @@
|
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
<li class="even ">
|
|
139
|
+
<div class="item">
|
|
140
|
+
<span class='object_link'><a href="Mint/Money.html#amount_to_s-instance_method" title="Mint::Money#amount_to_s (method)">#amount_to_s</a></span>
|
|
141
|
+
<small>Mint::Money</small>
|
|
142
|
+
</div>
|
|
143
|
+
</li>
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<li class="odd ">
|
|
139
147
|
<div class="item">
|
|
140
148
|
<span class='object_link'><a href="Mint/Rounding.html#apply-class_method" title="Mint::Rounding.apply (method)">apply</a></span>
|
|
141
149
|
<small>Mint::Rounding</small>
|
|
@@ -143,7 +151,7 @@
|
|
|
143
151
|
</li>
|
|
144
152
|
|
|
145
153
|
|
|
146
|
-
<li class="
|
|
154
|
+
<li class="even ">
|
|
147
155
|
<div class="item">
|
|
148
156
|
<span class='object_link'><a href="Mint/Money.html#clamp-instance_method" title="Mint::Money#clamp (method)">#clamp</a></span>
|
|
149
157
|
<small>Mint::Money</small>
|
|
@@ -151,7 +159,7 @@
|
|
|
151
159
|
</li>
|
|
152
160
|
|
|
153
161
|
|
|
154
|
-
<li class="
|
|
162
|
+
<li class="odd ">
|
|
155
163
|
<div class="item">
|
|
156
164
|
<span class='object_link'><a href="Mint/Currency.html#code-instance_method" title="Mint::Currency#code (method)">#code</a></span>
|
|
157
165
|
<small>Mint::Currency</small>
|
|
@@ -159,7 +167,7 @@
|
|
|
159
167
|
</li>
|
|
160
168
|
|
|
161
169
|
|
|
162
|
-
<li class="
|
|
170
|
+
<li class="even ">
|
|
163
171
|
<div class="item">
|
|
164
172
|
<span class='object_link'><a href="Mint/Money.html#coerce-instance_method" title="Mint::Money#coerce (method)">#coerce</a></span>
|
|
165
173
|
<small>Mint::Money</small>
|
|
@@ -167,9 +175,17 @@
|
|
|
167
175
|
</li>
|
|
168
176
|
|
|
169
177
|
|
|
178
|
+
<li class="odd ">
|
|
179
|
+
<div class="item">
|
|
180
|
+
<span class='object_link'><a href="Mint/Money.html#compile_formatter-class_method" title="Mint::Money.compile_formatter (method)">compile_formatter</a></span>
|
|
181
|
+
<small>Mint::Money</small>
|
|
182
|
+
</div>
|
|
183
|
+
</li>
|
|
184
|
+
|
|
185
|
+
|
|
170
186
|
<li class="even ">
|
|
171
187
|
<div class="item">
|
|
172
|
-
<span class='object_link'><a href="Mint/Money.html#
|
|
188
|
+
<span class='object_link'><a href="Mint/Money.html#compile_templates-class_method" title="Mint::Money.compile_templates (method)">compile_templates</a></span>
|
|
173
189
|
<small>Mint::Money</small>
|
|
174
190
|
</div>
|
|
175
191
|
</li>
|
|
@@ -177,21 +193,29 @@
|
|
|
177
193
|
|
|
178
194
|
<li class="odd ">
|
|
179
195
|
<div class="item">
|
|
180
|
-
<span class='object_link'><a href="Mint/
|
|
181
|
-
<small>Mint::
|
|
196
|
+
<span class='object_link'><a href="Mint/Money.html#compiled_formatters-class_method" title="Mint::Money.compiled_formatters (method)">compiled_formatters</a></span>
|
|
197
|
+
<small>Mint::Money</small>
|
|
182
198
|
</div>
|
|
183
199
|
</li>
|
|
184
200
|
|
|
185
201
|
|
|
186
202
|
<li class="even ">
|
|
187
203
|
<div class="item">
|
|
188
|
-
<span class='object_link'><a href="Mint/Money.html#
|
|
204
|
+
<span class='object_link'><a href="Mint/Money.html#copy_with-instance_method" title="Mint::Money#copy_with (method)">#copy_with</a></span>
|
|
189
205
|
<small>Mint::Money</small>
|
|
190
206
|
</div>
|
|
191
207
|
</li>
|
|
192
208
|
|
|
193
209
|
|
|
194
210
|
<li class="odd ">
|
|
211
|
+
<div class="item">
|
|
212
|
+
<span class='object_link'><a href="Mint/Currency.html#country-instance_method" title="Mint::Currency#country (method)">#country</a></span>
|
|
213
|
+
<small>Mint::Currency</small>
|
|
214
|
+
</div>
|
|
215
|
+
</li>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<li class="even ">
|
|
195
219
|
<div class="item">
|
|
196
220
|
<span class='object_link'><a href="Mint/Registry.html#currencies-class_method" title="Mint::Registry.currencies (method)">currencies</a></span>
|
|
197
221
|
<small>Mint::Registry</small>
|
|
@@ -199,7 +223,7 @@
|
|
|
199
223
|
</li>
|
|
200
224
|
|
|
201
225
|
|
|
202
|
-
<li class="
|
|
226
|
+
<li class="odd ">
|
|
203
227
|
<div class="item">
|
|
204
228
|
<span class='object_link'><a href="Mint/Money.html#currency-instance_method" title="Mint::Money#currency (method)">#currency</a></span>
|
|
205
229
|
<small>Mint::Money</small>
|
|
@@ -207,7 +231,7 @@
|
|
|
207
231
|
</li>
|
|
208
232
|
|
|
209
233
|
|
|
210
|
-
<li class="
|
|
234
|
+
<li class="even ">
|
|
211
235
|
<div class="item">
|
|
212
236
|
<span class='object_link'><a href="Mint/Money.html#currency_code-instance_method" title="Mint::Money#currency_code (method)">#currency_code</a></span>
|
|
213
237
|
<small>Mint::Money</small>
|
|
@@ -215,7 +239,7 @@
|
|
|
215
239
|
</li>
|
|
216
240
|
|
|
217
241
|
|
|
218
|
-
<li class="
|
|
242
|
+
<li class="odd ">
|
|
219
243
|
<div class="item">
|
|
220
244
|
<span class='object_link'><a href="Mint/Registry.html#currency_for_symbol-instance_method" title="Mint::Registry#currency_for_symbol (method)">#currency_for_symbol</a></span>
|
|
221
245
|
<small>Mint::Registry</small>
|
|
@@ -223,7 +247,7 @@
|
|
|
223
247
|
</li>
|
|
224
248
|
|
|
225
249
|
|
|
226
|
-
<li class="
|
|
250
|
+
<li class="even ">
|
|
227
251
|
<div class="item">
|
|
228
252
|
<span class='object_link'><a href="Mint/Rounding.html#current_mode-class_method" title="Mint::Rounding.current_mode (method)">current_mode</a></span>
|
|
229
253
|
<small>Mint::Rounding</small>
|
|
@@ -231,7 +255,7 @@
|
|
|
231
255
|
</li>
|
|
232
256
|
|
|
233
257
|
|
|
234
|
-
<li class="
|
|
258
|
+
<li class="odd ">
|
|
235
259
|
<div class="item">
|
|
236
260
|
<span class='object_link'><a href="Mint/Registry.html#detect_currency-instance_method" title="Mint::Registry#detect_currency (method)">#detect_currency</a></span>
|
|
237
261
|
<small>Mint::Registry</small>
|
|
@@ -239,7 +263,23 @@
|
|
|
239
263
|
</li>
|
|
240
264
|
|
|
241
265
|
|
|
266
|
+
<li class="even ">
|
|
267
|
+
<div class="item">
|
|
268
|
+
<span class='object_link'><a href="Mint/Currency.html#disambiguate_symbol-instance_method" title="Mint::Currency#disambiguate_symbol (method)">#disambiguate_symbol</a></span>
|
|
269
|
+
<small>Mint::Currency</small>
|
|
270
|
+
</div>
|
|
271
|
+
</li>
|
|
272
|
+
|
|
273
|
+
|
|
242
274
|
<li class="odd ">
|
|
275
|
+
<div class="item">
|
|
276
|
+
<span class='object_link'><a href="Numeric.html#dollars-instance_method" title="Numeric#dollars (method)">#dollars</a></span>
|
|
277
|
+
<small>Numeric</small>
|
|
278
|
+
</div>
|
|
279
|
+
</li>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
<li class="even ">
|
|
243
283
|
<div class="item">
|
|
244
284
|
<span class='object_link'><a href="Mint/Money.html#eql%3F-instance_method" title="Mint::Money#eql? (method)">#eql?</a></span>
|
|
245
285
|
<small>Mint::Money</small>
|
|
@@ -247,6 +287,14 @@
|
|
|
247
287
|
</li>
|
|
248
288
|
|
|
249
289
|
|
|
290
|
+
<li class="odd ">
|
|
291
|
+
<div class="item">
|
|
292
|
+
<span class='object_link'><a href="Numeric.html#euros-instance_method" title="Numeric#euros (method)">#euros</a></span>
|
|
293
|
+
<small>Numeric</small>
|
|
294
|
+
</div>
|
|
295
|
+
</li>
|
|
296
|
+
|
|
297
|
+
|
|
250
298
|
<li class="even ">
|
|
251
299
|
<div class="item">
|
|
252
300
|
<span class='object_link'><a href="Mint/Currency.html#for_code-class_method" title="Mint::Currency.for_code (method)">for_code</a></span>
|
|
@@ -265,13 +313,21 @@
|
|
|
265
313
|
|
|
266
314
|
<li class="even ">
|
|
267
315
|
<div class="item">
|
|
268
|
-
<span class='object_link'><a href="Mint/Money.html#
|
|
316
|
+
<span class='object_link'><a href="Mint/Money.html#format-instance_method" title="Mint::Money#format (method)">#format</a></span>
|
|
269
317
|
<small>Mint::Money</small>
|
|
270
318
|
</div>
|
|
271
319
|
</li>
|
|
272
320
|
|
|
273
321
|
|
|
274
322
|
<li class="odd ">
|
|
323
|
+
<div class="item">
|
|
324
|
+
<span class='object_link'><a href="Mint/Money.html#fractional-instance_method" title="Mint::Money#fractional (method)">#fractional</a></span>
|
|
325
|
+
<small>Mint::Money</small>
|
|
326
|
+
</div>
|
|
327
|
+
</li>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
<li class="even ">
|
|
275
331
|
<div class="item">
|
|
276
332
|
<span class='object_link'><a href="Mint/Currency.html#fractional_multiplier-instance_method" title="Mint::Currency#fractional_multiplier (method)">#fractional_multiplier</a></span>
|
|
277
333
|
<small>Mint::Currency</small>
|
|
@@ -279,7 +335,7 @@
|
|
|
279
335
|
</li>
|
|
280
336
|
|
|
281
337
|
|
|
282
|
-
<li class="
|
|
338
|
+
<li class="odd ">
|
|
283
339
|
<div class="item">
|
|
284
340
|
<span class='object_link'><a href="Mint/Money.html#from-class_method" title="Mint::Money.from (method)">from</a></span>
|
|
285
341
|
<small>Mint::Money</small>
|
|
@@ -287,7 +343,7 @@
|
|
|
287
343
|
</li>
|
|
288
344
|
|
|
289
345
|
|
|
290
|
-
<li class="
|
|
346
|
+
<li class="even ">
|
|
291
347
|
<div class="item">
|
|
292
348
|
<span class='object_link'><a href="Mint/Money.html#from_subunits-class_method" title="Mint::Money.from_subunits (method)">from_subunits</a></span>
|
|
293
349
|
<small>Mint::Money</small>
|
|
@@ -295,7 +351,7 @@
|
|
|
295
351
|
</li>
|
|
296
352
|
|
|
297
353
|
|
|
298
|
-
<li class="
|
|
354
|
+
<li class="odd ">
|
|
299
355
|
<div class="item">
|
|
300
356
|
<span class='object_link'><a href="Mint/Money.html#hash-instance_method" title="Mint::Money#hash (method)">#hash</a></span>
|
|
301
357
|
<small>Mint::Money</small>
|
|
@@ -303,7 +359,7 @@
|
|
|
303
359
|
</li>
|
|
304
360
|
|
|
305
361
|
|
|
306
|
-
<li class="
|
|
362
|
+
<li class="even ">
|
|
307
363
|
<div class="item">
|
|
308
364
|
<span class='object_link'><a href="Mint/Currency.html#initialize-instance_method" title="Mint::Currency#initialize (method)">#initialize</a></span>
|
|
309
365
|
<small>Mint::Currency</small>
|
|
@@ -311,7 +367,7 @@
|
|
|
311
367
|
</li>
|
|
312
368
|
|
|
313
369
|
|
|
314
|
-
<li class="
|
|
370
|
+
<li class="odd ">
|
|
315
371
|
<div class="item">
|
|
316
372
|
<span class='object_link'><a href="Mint/Money.html#inspect-instance_method" title="Mint::Money#inspect (method)">#inspect</a></span>
|
|
317
373
|
<small>Mint::Money</small>
|
|
@@ -319,7 +375,7 @@
|
|
|
319
375
|
</li>
|
|
320
376
|
|
|
321
377
|
|
|
322
|
-
<li class="
|
|
378
|
+
<li class="even ">
|
|
323
379
|
<div class="item">
|
|
324
380
|
<span class='object_link'><a href="Mint/Currency.html#inspect-instance_method" title="Mint::Currency#inspect (method)">#inspect</a></span>
|
|
325
381
|
<small>Mint::Currency</small>
|
|
@@ -327,7 +383,7 @@
|
|
|
327
383
|
</li>
|
|
328
384
|
|
|
329
385
|
|
|
330
|
-
<li class="
|
|
386
|
+
<li class="odd ">
|
|
331
387
|
<div class="item">
|
|
332
388
|
<span class='object_link'><a href="Mint.html#locale_backend-class_method" title="Mint.locale_backend (method)">locale_backend</a></span>
|
|
333
389
|
<small>Mint</small>
|
|
@@ -335,7 +391,7 @@
|
|
|
335
391
|
</li>
|
|
336
392
|
|
|
337
393
|
|
|
338
|
-
<li class="
|
|
394
|
+
<li class="even ">
|
|
339
395
|
<div class="item">
|
|
340
396
|
<span class='object_link'><a href="Mint/Currency.html#minimum_amount-instance_method" title="Mint::Currency#minimum_amount (method)">#minimum_amount</a></span>
|
|
341
397
|
<small>Mint::Currency</small>
|
|
@@ -343,7 +399,7 @@
|
|
|
343
399
|
</li>
|
|
344
400
|
|
|
345
401
|
|
|
346
|
-
<li class="
|
|
402
|
+
<li class="odd deprecated">
|
|
347
403
|
<div class="item">
|
|
348
404
|
<span class='object_link'><a href="Mint/Money.html#mint-instance_method" title="Mint::Money#mint (method)">#mint</a></span>
|
|
349
405
|
<small>Mint::Money</small>
|
|
@@ -351,7 +407,7 @@
|
|
|
351
407
|
</li>
|
|
352
408
|
|
|
353
409
|
|
|
354
|
-
<li class="
|
|
410
|
+
<li class="even ">
|
|
355
411
|
<div class="item">
|
|
356
412
|
<span class='object_link'><a href="Mint.html#money-class_method" title="Mint.money (method)">money</a></span>
|
|
357
413
|
<small>Mint</small>
|
|
@@ -359,7 +415,7 @@
|
|
|
359
415
|
</li>
|
|
360
416
|
|
|
361
417
|
|
|
362
|
-
<li class="
|
|
418
|
+
<li class="odd ">
|
|
363
419
|
<div class="item">
|
|
364
420
|
<span class='object_link'><a href="Mint/Currency.html#name-instance_method" title="Mint::Currency#name (method)">#name</a></span>
|
|
365
421
|
<small>Mint::Currency</small>
|
|
@@ -367,7 +423,7 @@
|
|
|
367
423
|
</li>
|
|
368
424
|
|
|
369
425
|
|
|
370
|
-
<li class="
|
|
426
|
+
<li class="even ">
|
|
371
427
|
<div class="item">
|
|
372
428
|
<span class='object_link'><a href="Mint/Money.html#negative%3F-instance_method" title="Mint::Money#negative? (method)">#negative?</a></span>
|
|
373
429
|
<small>Mint::Money</small>
|
|
@@ -375,7 +431,7 @@
|
|
|
375
431
|
</li>
|
|
376
432
|
|
|
377
433
|
|
|
378
|
-
<li class="
|
|
434
|
+
<li class="odd ">
|
|
379
435
|
<div class="item">
|
|
380
436
|
<span class='object_link'><a href="Mint/Money.html#no_currency-class_method" title="Mint::Money.no_currency (method)">no_currency</a></span>
|
|
381
437
|
<small>Mint::Money</small>
|
|
@@ -383,7 +439,7 @@
|
|
|
383
439
|
</li>
|
|
384
440
|
|
|
385
441
|
|
|
386
|
-
<li class="
|
|
442
|
+
<li class="even ">
|
|
387
443
|
<div class="item">
|
|
388
444
|
<span class='object_link'><a href="Mint/Money.html#nonzero%3F-instance_method" title="Mint::Money#nonzero? (method)">#nonzero?</a></span>
|
|
389
445
|
<small>Mint::Money</small>
|
|
@@ -391,7 +447,7 @@
|
|
|
391
447
|
</li>
|
|
392
448
|
|
|
393
449
|
|
|
394
|
-
<li class="
|
|
450
|
+
<li class="odd ">
|
|
395
451
|
<div class="item">
|
|
396
452
|
<span class='object_link'><a href="Mint/Currency.html#normalize_amount-instance_method" title="Mint::Currency#normalize_amount (method)">#normalize_amount</a></span>
|
|
397
453
|
<small>Mint::Currency</small>
|
|
@@ -399,7 +455,7 @@
|
|
|
399
455
|
</li>
|
|
400
456
|
|
|
401
457
|
|
|
402
|
-
<li class="
|
|
458
|
+
<li class="even ">
|
|
403
459
|
<div class="item">
|
|
404
460
|
<span class='object_link'><a href="Mint.html#parse-instance_method" title="Mint#parse (method)">#parse</a></span>
|
|
405
461
|
<small>Mint</small>
|
|
@@ -407,7 +463,7 @@
|
|
|
407
463
|
</li>
|
|
408
464
|
|
|
409
465
|
|
|
410
|
-
<li class="
|
|
466
|
+
<li class="odd ">
|
|
411
467
|
<div class="item">
|
|
412
468
|
<span class='object_link'><a href="Mint/Money.html#parse-class_method" title="Mint::Money.parse (method)">parse</a></span>
|
|
413
469
|
<small>Mint::Money</small>
|
|
@@ -415,6 +471,14 @@
|
|
|
415
471
|
</li>
|
|
416
472
|
|
|
417
473
|
|
|
474
|
+
<li class="even ">
|
|
475
|
+
<div class="item">
|
|
476
|
+
<span class='object_link'><a href="Mint/Money.html#parse!-class_method" title="Mint::Money.parse! (method)">parse!</a></span>
|
|
477
|
+
<small>Mint::Money</small>
|
|
478
|
+
</div>
|
|
479
|
+
</li>
|
|
480
|
+
|
|
481
|
+
|
|
418
482
|
<li class="odd ">
|
|
419
483
|
<div class="item">
|
|
420
484
|
<span class='object_link'><a href="Mint.html#parse!-instance_method" title="Mint#parse! (method)">#parse!</a></span>
|
|
@@ -425,7 +489,7 @@
|
|
|
425
489
|
|
|
426
490
|
<li class="even ">
|
|
427
491
|
<div class="item">
|
|
428
|
-
<span class='object_link'><a href="Mint/Money.html#
|
|
492
|
+
<span class='object_link'><a href="Mint/Money.html#positive%3F-instance_method" title="Mint::Money#positive? (method)">#positive?</a></span>
|
|
429
493
|
<small>Mint::Money</small>
|
|
430
494
|
</div>
|
|
431
495
|
</li>
|
|
@@ -433,32 +497,32 @@
|
|
|
433
497
|
|
|
434
498
|
<li class="odd ">
|
|
435
499
|
<div class="item">
|
|
436
|
-
<span class='object_link'><a href="Mint/
|
|
437
|
-
<small>Mint::
|
|
500
|
+
<span class='object_link'><a href="Mint/Currency.html#priority-instance_method" title="Mint::Currency#priority (method)">#priority</a></span>
|
|
501
|
+
<small>Mint::Currency</small>
|
|
438
502
|
</div>
|
|
439
503
|
</li>
|
|
440
504
|
|
|
441
505
|
|
|
442
506
|
<li class="even ">
|
|
443
507
|
<div class="item">
|
|
444
|
-
<span class='object_link'><a href="
|
|
445
|
-
<small>
|
|
508
|
+
<span class='object_link'><a href="Numeric.html#reais-instance_method" title="Numeric#reais (method)">#reais</a></span>
|
|
509
|
+
<small>Numeric</small>
|
|
446
510
|
</div>
|
|
447
511
|
</li>
|
|
448
512
|
|
|
449
513
|
|
|
450
514
|
<li class="odd ">
|
|
451
515
|
<div class="item">
|
|
452
|
-
<span class='object_link'><a href="Mint/
|
|
453
|
-
<small>Mint::
|
|
516
|
+
<span class='object_link'><a href="Mint/Registry.html#register-class_method" title="Mint::Registry.register (method)">register</a></span>
|
|
517
|
+
<small>Mint::Registry</small>
|
|
454
518
|
</div>
|
|
455
519
|
</li>
|
|
456
520
|
|
|
457
521
|
|
|
458
522
|
<li class="even ">
|
|
459
523
|
<div class="item">
|
|
460
|
-
<span class='object_link'><a href="Mint/
|
|
461
|
-
<small>Mint::
|
|
524
|
+
<span class='object_link'><a href="Mint/Currency.html#register-class_method" title="Mint::Currency.register (method)">register</a></span>
|
|
525
|
+
<small>Mint::Currency</small>
|
|
462
526
|
</div>
|
|
463
527
|
</li>
|
|
464
528
|
|
|
@@ -585,29 +649,37 @@
|
|
|
585
649
|
|
|
586
650
|
<li class="even ">
|
|
587
651
|
<div class="item">
|
|
588
|
-
<span class='object_link'><a href="
|
|
589
|
-
<small>
|
|
652
|
+
<span class='object_link'><a href="String.html#to_money-instance_method" title="String#to_money (method)">#to_money</a></span>
|
|
653
|
+
<small>String</small>
|
|
590
654
|
</div>
|
|
591
655
|
</li>
|
|
592
656
|
|
|
593
657
|
|
|
594
658
|
<li class="odd ">
|
|
595
659
|
<div class="item">
|
|
596
|
-
<span class='object_link'><a href="
|
|
597
|
-
<small>
|
|
660
|
+
<span class='object_link'><a href="Numeric.html#to_money-instance_method" title="Numeric#to_money (method)">#to_money</a></span>
|
|
661
|
+
<small>Numeric</small>
|
|
598
662
|
</div>
|
|
599
663
|
</li>
|
|
600
664
|
|
|
601
665
|
|
|
602
666
|
<li class="even ">
|
|
603
667
|
<div class="item">
|
|
604
|
-
<span class='object_link'><a href="Mint.html#
|
|
605
|
-
<small>Mint</small>
|
|
668
|
+
<span class='object_link'><a href="Mint/Money.html#to_r-instance_method" title="Mint::Money#to_r (method)">#to_r</a></span>
|
|
669
|
+
<small>Mint::Money</small>
|
|
606
670
|
</div>
|
|
607
671
|
</li>
|
|
608
672
|
|
|
609
673
|
|
|
610
674
|
<li class="odd ">
|
|
675
|
+
<div class="item">
|
|
676
|
+
<span class='object_link'><a href="Mint/Money.html#to_s-instance_method" title="Mint::Money#to_s (method)">#to_s</a></span>
|
|
677
|
+
<small>Mint::Money</small>
|
|
678
|
+
</div>
|
|
679
|
+
</li>
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
<li class="even ">
|
|
611
683
|
<div class="item">
|
|
612
684
|
<span class='object_link'><a href="Mint/Rounding.html#with_mode-class_method" title="Mint::Rounding.with_mode (method)">with_mode</a></span>
|
|
613
685
|
<small>Mint::Rounding</small>
|
|
@@ -615,7 +687,7 @@
|
|
|
615
687
|
</li>
|
|
616
688
|
|
|
617
689
|
|
|
618
|
-
<li class="
|
|
690
|
+
<li class="odd ">
|
|
619
691
|
<div class="item">
|
|
620
692
|
<span class='object_link'><a href="Mint.html#with_rounding-class_method" title="Mint.with_rounding (method)">with_rounding</a></span>
|
|
621
693
|
<small>Mint</small>
|
|
@@ -623,7 +695,7 @@
|
|
|
623
695
|
</li>
|
|
624
696
|
|
|
625
697
|
|
|
626
|
-
<li class="
|
|
698
|
+
<li class="even ">
|
|
627
699
|
<div class="item">
|
|
628
700
|
<span class='object_link'><a href="Mint/Registry.html#world_currencies-class_method" title="Mint::Registry.world_currencies (method)">world_currencies</a></span>
|
|
629
701
|
<small>Mint::Registry</small>
|
|
@@ -631,7 +703,7 @@
|
|
|
631
703
|
</li>
|
|
632
704
|
|
|
633
705
|
|
|
634
|
-
<li class="
|
|
706
|
+
<li class="odd ">
|
|
635
707
|
<div class="item">
|
|
636
708
|
<span class='object_link'><a href="Mint.html#world_currencies-class_method" title="Mint.world_currencies (method)">world_currencies</a></span>
|
|
637
709
|
<small>Mint</small>
|
|
@@ -639,7 +711,7 @@
|
|
|
639
711
|
</li>
|
|
640
712
|
|
|
641
713
|
|
|
642
|
-
<li class="
|
|
714
|
+
<li class="even ">
|
|
643
715
|
<div class="item">
|
|
644
716
|
<span class='object_link'><a href="Mint/Currency.html#zero-class_method" title="Mint::Currency.zero (method)">zero</a></span>
|
|
645
717
|
<small>Mint::Currency</small>
|
|
@@ -647,7 +719,7 @@
|
|
|
647
719
|
</li>
|
|
648
720
|
|
|
649
721
|
|
|
650
|
-
<li class="
|
|
722
|
+
<li class="odd ">
|
|
651
723
|
<div class="item">
|
|
652
724
|
<span class='object_link'><a href="Mint/Currency.html#zero-instance_method" title="Mint::Currency#zero (method)">#zero</a></span>
|
|
653
725
|
<small>Mint::Currency</small>
|
|
@@ -655,7 +727,7 @@
|
|
|
655
727
|
</li>
|
|
656
728
|
|
|
657
729
|
|
|
658
|
-
<li class="
|
|
730
|
+
<li class="even ">
|
|
659
731
|
<div class="item">
|
|
660
732
|
<span class='object_link'><a href="Mint/Money.html#zero-class_method" title="Mint::Money.zero (method)">zero</a></span>
|
|
661
733
|
<small>Mint::Money</small>
|
|
@@ -663,7 +735,7 @@
|
|
|
663
735
|
</li>
|
|
664
736
|
|
|
665
737
|
|
|
666
|
-
<li class="
|
|
738
|
+
<li class="odd ">
|
|
667
739
|
<div class="item">
|
|
668
740
|
<span class='object_link'><a href="Mint/Money.html#zero%3F-instance_method" title="Mint::Money#zero? (method)">#zero?</a></span>
|
|
669
741
|
<small>Mint::Money</small>
|
|
@@ -671,7 +743,7 @@
|
|
|
671
743
|
</li>
|
|
672
744
|
|
|
673
745
|
|
|
674
|
-
<li class="
|
|
746
|
+
<li class="even ">
|
|
675
747
|
<div class="item">
|
|
676
748
|
<span class='object_link'><a href="Mint/Registry.html#zero_for-class_method" title="Mint::Registry.zero_for (method)">zero_for</a></span>
|
|
677
749
|
<small>Mint::Registry</small>
|
|
@@ -88,6 +88,8 @@
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
|
|
91
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Numeric.html" title="Numeric (class)">Numeric</a></span>, <span class='object_link'><a href="String.html" title="String (class)">String</a></span>
|
|
92
|
+
|
|
91
93
|
|
|
92
94
|
</p>
|
|
93
95
|
|
|
@@ -100,30 +102,12 @@
|
|
|
100
102
|
<dl class="constants">
|
|
101
103
|
|
|
102
104
|
<dt id="Money-constant" class="">Money =
|
|
103
|
-
|
|
104
|
-
<div class="discussion">
|
|
105
|
-
<p>Alias for <span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Mint::Money</a></span> — enables <code>Money.new(...)</code> shorthand.</p>
|
|
106
|
-
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
<div class="tags">
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
</div>
|
|
105
|
+
|
|
113
106
|
</dt>
|
|
114
107
|
<dd><pre class="code"><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></pre></dd>
|
|
115
108
|
|
|
116
109
|
<dt id="Currency-constant" class="">Currency =
|
|
117
|
-
|
|
118
|
-
<div class="discussion">
|
|
119
|
-
<p>Alias for <span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Mint::Currency</a></span> — enables <code>Currency.new(...)</code> shorthand.</p>
|
|
120
|
-
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
<div class="tags">
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</div>
|
|
110
|
+
|
|
127
111
|
</dt>
|
|
128
112
|
<dd><pre class="code"><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/Currency.html" title="Mint::Currency (class)">Currency</a></span></span></pre></dd>
|
|
129
113
|
|
|
@@ -141,7 +125,7 @@
|
|
|
141
125
|
</div>
|
|
142
126
|
|
|
143
127
|
<div id="footer">
|
|
144
|
-
Generated on
|
|
128
|
+
Generated on Wed Jul 1 01:11:52 2026 by
|
|
145
129
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
146
130
|
0.9.44 (ruby-4.0.5).
|
|
147
131
|
</div>
|
|
@@ -15,20 +15,23 @@ module Mint
|
|
|
15
15
|
# @attr_reader name [String, nil] Currency name
|
|
16
16
|
# @attr_reader fractional_multiplier [Integer] 10^subunit, used for fractional conversions
|
|
17
17
|
# @attr_reader minimum_amount [Rational] Smallest representable amount (1/fractional_multiplier)
|
|
18
|
+
# @attr_reader disambiguate_symbol [String, nil] A longer, code-prefixed variant to distinguish
|
|
19
|
+
# currencies that share the same primary symbol (e.g. "US$" for USD, "C$" for CAD).
|
|
18
20
|
Currency = Data.define(:code, :subunit, :symbol, :priority, :country, :name,
|
|
19
|
-
:fractional_multiplier) do
|
|
21
|
+
:fractional_multiplier, :disambiguate_symbol) do
|
|
20
22
|
# @param code [String] ISO 4217 currency code
|
|
21
23
|
# @param symbol [String] Display symbol
|
|
22
24
|
# @param subunit [Integer] Number of decimal places (default 0)
|
|
23
25
|
# @param priority [Integer] Parser precedence for symbol detection (default 0)
|
|
24
26
|
# @param country [String, nil] Associated country code (default nil)
|
|
25
27
|
# @param name [String, nil] Currency name (default nil)
|
|
26
|
-
def initialize(code:, symbol:, subunit: 0, priority: 0, country: nil, name: nil
|
|
28
|
+
def initialize(code:, symbol:, subunit: 0, priority: 0, country: nil, name: nil,
|
|
29
|
+
disambiguate_symbol: nil)
|
|
27
30
|
subunit = subunit.to_i
|
|
28
31
|
priority = priority.to_i
|
|
29
32
|
fractional_multiplier = 10**subunit
|
|
30
33
|
super(code:, subunit:, symbol:, priority:, country:, name:,
|
|
31
|
-
fractional_multiplier:)
|
|
34
|
+
fractional_multiplier:, disambiguate_symbol:)
|
|
32
35
|
end
|
|
33
36
|
|
|
34
37
|
# @return [String] debug representation
|