minting 1.7.0 → 1.7.2
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 +71 -118
- data/Rakefile +13 -1
- data/bin/bench_check +46 -0
- data/doc/Mint/Currency.html +178 -32
- data/doc/Mint/CurrencyRegistry.html +7 -7
- data/doc/Mint/Money.html +128 -125
- data/doc/Mint/RangeStepPatch.html +277 -0
- data/doc/Mint/UnknownCurrency.html +2 -2
- data/doc/Mint.html +47 -22
- data/doc/Minting.html +3 -3
- data/doc/_index.html +17 -2
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +86 -89
- data/doc/index.html +86 -89
- data/doc/method_list.html +29 -21
- data/doc/top-level-namespace.html +13 -5
- data/lib/minting/{mint/currency → currency}/currency.rb +8 -0
- data/lib/minting/{mint/currency → currency}/world_currencies.rb +1 -1
- data/lib/minting/mint/aliases.rb +3 -0
- data/lib/minting/mint/dsl/{refinements.rb → numeric.rb} +6 -5
- data/lib/minting/mint/dsl/range.rb +31 -18
- data/lib/minting/mint/dsl/string.rb +12 -0
- data/lib/minting/mint/dsl/top_level.rb +3 -0
- data/lib/minting/mint/mint.rb +16 -2
- data/lib/minting/mint/parser/parser.rb +66 -0
- data/lib/minting/mint/parser/separators.rb +39 -0
- data/lib/minting/mint.rb +17 -8
- data/lib/minting/money/allocation/allocation.rb +25 -0
- data/lib/minting/money/{allocation.rb → allocation/split.rb} +1 -19
- data/lib/minting/money/arithmetics/methods.rb +27 -0
- data/lib/minting/money/{arithmetics.rb → arithmetics/operators.rb} +0 -21
- data/lib/minting/money/clamp.rb +66 -0
- data/lib/minting/money/coercion.rb +10 -0
- data/lib/minting/money/comparable.rb +6 -0
- data/lib/minting/money/constructors.rb +13 -3
- data/lib/minting/money/format/formatting.rb +44 -0
- data/lib/minting/money/{formatting.rb → format/to_s.rb} +0 -32
- data/lib/minting/money/money.rb +0 -58
- data/lib/minting/version.rb +1 -1
- metadata +19 -14
- data/lib/minting/mint/parser.rb +0 -85
- /data/lib/minting/{mint/currency → currency}/currency_registry.rb +0 -0
data/doc/Mint/Currency.html
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
|
|
99
99
|
<dl>
|
|
100
100
|
<dt>Defined in:</dt>
|
|
101
|
-
<dd>lib/minting/
|
|
101
|
+
<dd>lib/minting/currency/currency.rb
|
|
102
102
|
</dd>
|
|
103
103
|
</dl>
|
|
104
104
|
|
|
@@ -358,7 +358,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
358
358
|
<li class="public ">
|
|
359
359
|
<span class="summary_signature">
|
|
360
360
|
|
|
361
|
-
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> ⇒
|
|
361
|
+
<a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> ⇒ String </a>
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
|
|
@@ -372,7 +372,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
372
372
|
|
|
373
373
|
|
|
374
374
|
|
|
375
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
|
375
|
+
<span class="summary_desc"><div class='inline'><p>Debug representation.</p></div></span>
|
|
376
376
|
|
|
377
377
|
</li>
|
|
378
378
|
|
|
@@ -380,7 +380,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
380
380
|
<li class="public ">
|
|
381
381
|
<span class="summary_signature">
|
|
382
382
|
|
|
383
|
-
<a href="#minimum_amount-instance_method" title="#minimum_amount (instance method)">#<strong>minimum_amount</strong> ⇒
|
|
383
|
+
<a href="#minimum_amount-instance_method" title="#minimum_amount (instance method)">#<strong>minimum_amount</strong> ⇒ Rational </a>
|
|
384
384
|
|
|
385
385
|
|
|
386
386
|
|
|
@@ -394,7 +394,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
394
394
|
|
|
395
395
|
|
|
396
396
|
|
|
397
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
|
397
|
+
<span class="summary_desc"><div class='inline'><p>Smallest representable amount (1/fractional_multiplier).</p></div></span>
|
|
398
398
|
|
|
399
399
|
</li>
|
|
400
400
|
|
|
@@ -445,7 +445,103 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
445
445
|
</div>
|
|
446
446
|
</div>
|
|
447
447
|
<div class="tags">
|
|
448
|
+
<p class="tag_title">Parameters:</p>
|
|
449
|
+
<ul class="param">
|
|
448
450
|
|
|
451
|
+
<li>
|
|
452
|
+
|
|
453
|
+
<span class='name'>code</span>
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
—
|
|
461
|
+
<div class='inline'><p>ISO 4217 currency code</p></div>
|
|
462
|
+
|
|
463
|
+
</li>
|
|
464
|
+
|
|
465
|
+
<li>
|
|
466
|
+
|
|
467
|
+
<span class='name'>symbol</span>
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
—
|
|
475
|
+
<div class='inline'><p>Display symbol</p></div>
|
|
476
|
+
|
|
477
|
+
</li>
|
|
478
|
+
|
|
479
|
+
<li>
|
|
480
|
+
|
|
481
|
+
<span class='name'>subunit</span>
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
<em class="default">(defaults to: <tt>0</tt>)</em>
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
—
|
|
491
|
+
<div class='inline'><p>Number of decimal places (default 0)</p></div>
|
|
492
|
+
|
|
493
|
+
</li>
|
|
494
|
+
|
|
495
|
+
<li>
|
|
496
|
+
|
|
497
|
+
<span class='name'>priority</span>
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
<em class="default">(defaults to: <tt>0</tt>)</em>
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
—
|
|
507
|
+
<div class='inline'><p>Parser precedence for symbol detection (default 0)</p></div>
|
|
508
|
+
|
|
509
|
+
</li>
|
|
510
|
+
|
|
511
|
+
<li>
|
|
512
|
+
|
|
513
|
+
<span class='name'>country</span>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
—
|
|
523
|
+
<div class='inline'><p>Associated country code (default nil)</p></div>
|
|
524
|
+
|
|
525
|
+
</li>
|
|
526
|
+
|
|
527
|
+
<li>
|
|
528
|
+
|
|
529
|
+
<span class='name'>name</span>
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
<span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
—
|
|
539
|
+
<div class='inline'><p>Currency name (default nil)</p></div>
|
|
540
|
+
|
|
541
|
+
</li>
|
|
542
|
+
|
|
543
|
+
</ul>
|
|
544
|
+
|
|
449
545
|
|
|
450
546
|
</div><table class="source_code">
|
|
451
547
|
<tr>
|
|
@@ -453,16 +549,16 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
453
549
|
<pre class="lines">
|
|
454
550
|
|
|
455
551
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
552
|
+
25
|
|
553
|
+
26
|
|
554
|
+
27
|
|
555
|
+
28
|
|
556
|
+
29
|
|
557
|
+
30
|
|
558
|
+
31</pre>
|
|
463
559
|
</td>
|
|
464
560
|
<td>
|
|
465
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
561
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 25</span>
|
|
466
562
|
|
|
467
563
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>code:</span><span class='comma'>,</span> <span class='label'>symbol:</span><span class='comma'>,</span> <span class='label'>subunit:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='label'>country:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>name:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
468
564
|
<span class='id identifier rubyid_subunit'>subunit</span> <span class='op'>=</span> <span class='id identifier rubyid_subunit'>subunit</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
|
@@ -528,7 +624,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
528
624
|
19</pre>
|
|
529
625
|
</td>
|
|
530
626
|
<td>
|
|
531
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
627
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
532
628
|
|
|
533
629
|
<span class='kw'>def</span> <span class='id identifier rubyid_code'>code</span>
|
|
534
630
|
<span class='ivar'>@code</span>
|
|
@@ -585,7 +681,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
585
681
|
19</pre>
|
|
586
682
|
</td>
|
|
587
683
|
<td>
|
|
588
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
684
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
589
685
|
|
|
590
686
|
<span class='kw'>def</span> <span class='id identifier rubyid_country'>country</span>
|
|
591
687
|
<span class='ivar'>@country</span>
|
|
@@ -642,7 +738,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
642
738
|
19</pre>
|
|
643
739
|
</td>
|
|
644
740
|
<td>
|
|
645
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
646
742
|
|
|
647
743
|
<span class='kw'>def</span> <span class='id identifier rubyid_fractional_multiplier'>fractional_multiplier</span>
|
|
648
744
|
<span class='ivar'>@fractional_multiplier</span>
|
|
@@ -699,7 +795,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
699
795
|
19</pre>
|
|
700
796
|
</td>
|
|
701
797
|
<td>
|
|
702
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
798
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
703
799
|
|
|
704
800
|
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
|
705
801
|
<span class='ivar'>@name</span>
|
|
@@ -756,7 +852,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
756
852
|
19</pre>
|
|
757
853
|
</td>
|
|
758
854
|
<td>
|
|
759
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
855
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
760
856
|
|
|
761
857
|
<span class='kw'>def</span> <span class='id identifier rubyid_priority'>priority</span>
|
|
762
858
|
<span class='ivar'>@priority</span>
|
|
@@ -813,7 +909,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
813
909
|
19</pre>
|
|
814
910
|
</td>
|
|
815
911
|
<td>
|
|
816
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
912
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
817
913
|
|
|
818
914
|
<span class='kw'>def</span> <span class='id identifier rubyid_subunit'>subunit</span>
|
|
819
915
|
<span class='ivar'>@subunit</span>
|
|
@@ -870,7 +966,7 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
870
966
|
19</pre>
|
|
871
967
|
</td>
|
|
872
968
|
<td>
|
|
873
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
969
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 17</span>
|
|
874
970
|
|
|
875
971
|
<span class='kw'>def</span> <span class='id identifier rubyid_symbol'>symbol</span>
|
|
876
972
|
<span class='ivar'>@symbol</span>
|
|
@@ -890,22 +986,47 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
890
986
|
<div class="method_details first">
|
|
891
987
|
<h3 class="signature first" id="inspect-instance_method">
|
|
892
988
|
|
|
893
|
-
#<strong>inspect</strong> ⇒ <tt>
|
|
989
|
+
#<strong>inspect</strong> ⇒ <tt>String</tt>
|
|
990
|
+
|
|
991
|
+
|
|
894
992
|
|
|
895
993
|
|
|
896
994
|
|
|
995
|
+
</h3><div class="docstring">
|
|
996
|
+
<div class="discussion">
|
|
997
|
+
<p>Returns debug representation.</p>
|
|
897
998
|
|
|
999
|
+
</div>
|
|
1000
|
+
</div>
|
|
1001
|
+
<div class="tags">
|
|
1002
|
+
|
|
1003
|
+
<p class="tag_title">Returns:</p>
|
|
1004
|
+
<ul class="return">
|
|
898
1005
|
|
|
899
|
-
|
|
1006
|
+
<li>
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
—
|
|
1014
|
+
<div class='inline'><p>debug representation</p></div>
|
|
1015
|
+
|
|
1016
|
+
</li>
|
|
1017
|
+
|
|
1018
|
+
</ul>
|
|
1019
|
+
|
|
1020
|
+
</div><table class="source_code">
|
|
900
1021
|
<tr>
|
|
901
1022
|
<td>
|
|
902
1023
|
<pre class="lines">
|
|
903
1024
|
|
|
904
1025
|
|
|
905
|
-
|
|
1026
|
+
34</pre>
|
|
906
1027
|
</td>
|
|
907
1028
|
<td>
|
|
908
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
1029
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 34</span>
|
|
909
1030
|
|
|
910
1031
|
<span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'><Currency:(</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_code'>code</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_symbol'>symbol</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_subunit'>subunit</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>)></span><span class='tstring_end'>"</span></span></pre>
|
|
911
1032
|
</td>
|
|
@@ -916,22 +1037,47 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
916
1037
|
<div class="method_details ">
|
|
917
1038
|
<h3 class="signature " id="minimum_amount-instance_method">
|
|
918
1039
|
|
|
919
|
-
#<strong>minimum_amount</strong> ⇒ <tt>
|
|
1040
|
+
#<strong>minimum_amount</strong> ⇒ <tt>Rational</tt>
|
|
1041
|
+
|
|
1042
|
+
|
|
920
1043
|
|
|
921
1044
|
|
|
922
1045
|
|
|
1046
|
+
</h3><div class="docstring">
|
|
1047
|
+
<div class="discussion">
|
|
1048
|
+
<p>Returns smallest representable amount (1/fractional_multiplier).</p>
|
|
923
1049
|
|
|
1050
|
+
</div>
|
|
1051
|
+
</div>
|
|
1052
|
+
<div class="tags">
|
|
924
1053
|
|
|
925
|
-
|
|
1054
|
+
<p class="tag_title">Returns:</p>
|
|
1055
|
+
<ul class="return">
|
|
1056
|
+
|
|
1057
|
+
<li>
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
<span class='type'>(<tt>Rational</tt>)</span>
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
—
|
|
1065
|
+
<div class='inline'><p>smallest representable amount (1/fractional_multiplier)</p></div>
|
|
1066
|
+
|
|
1067
|
+
</li>
|
|
1068
|
+
|
|
1069
|
+
</ul>
|
|
1070
|
+
|
|
1071
|
+
</div><table class="source_code">
|
|
926
1072
|
<tr>
|
|
927
1073
|
<td>
|
|
928
1074
|
<pre class="lines">
|
|
929
1075
|
|
|
930
1076
|
|
|
931
|
-
|
|
1077
|
+
37</pre>
|
|
932
1078
|
</td>
|
|
933
1079
|
<td>
|
|
934
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
1080
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 37</span>
|
|
935
1081
|
|
|
936
1082
|
<span class='kw'>def</span> <span class='id identifier rubyid_minimum_amount'>minimum_amount</span> <span class='op'>=</span> <span class='const'>Rational</span><span class='lparen'>(</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_fractional_multiplier'>fractional_multiplier</span><span class='rparen'>)</span></pre>
|
|
937
1083
|
</td>
|
|
@@ -967,10 +1113,10 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
967
1113
|
<pre class="lines">
|
|
968
1114
|
|
|
969
1115
|
|
|
970
|
-
|
|
1116
|
+
42</pre>
|
|
971
1117
|
</td>
|
|
972
1118
|
<td>
|
|
973
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
1119
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency.rb', line 42</span>
|
|
974
1120
|
|
|
975
1121
|
<span class='kw'>def</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> <span class='op'>=</span> <span class='id identifier rubyid_amount'>amount</span><span class='period'>.</span><span class='id identifier rubyid_to_r'>to_r</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='id identifier rubyid_subunit'>subunit</span><span class='rparen'>)</span></pre>
|
|
976
1122
|
</td>
|
|
@@ -983,9 +1129,9 @@ including its subunit precision, display symbol, and formatting rules.</p>
|
|
|
983
1129
|
</div>
|
|
984
1130
|
|
|
985
1131
|
<div id="footer">
|
|
986
|
-
Generated on
|
|
1132
|
+
Generated on Sun Jun 14 21:57:01 2026 by
|
|
987
1133
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
988
|
-
0.9.44 (ruby-4.0.
|
|
1134
|
+
0.9.44 (ruby-4.0.5).
|
|
989
1135
|
</div>
|
|
990
1136
|
|
|
991
1137
|
</div>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
<dl>
|
|
92
92
|
<dt>Defined in:</dt>
|
|
93
|
-
<dd>lib/minting/
|
|
93
|
+
<dd>lib/minting/currency/currency_registry.rb
|
|
94
94
|
</dd>
|
|
95
95
|
</dl>
|
|
96
96
|
|
|
@@ -246,7 +246,7 @@ Manages the registry cache and currency symbol lookups.</p>
|
|
|
246
246
|
18</pre>
|
|
247
247
|
</td>
|
|
248
248
|
<td>
|
|
249
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
249
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency_registry.rb', line 16</span>
|
|
250
250
|
|
|
251
251
|
<span class='kw'>def</span> <span class='id identifier rubyid_currencies'>currencies</span>
|
|
252
252
|
<span class='ivar'>@currencies</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='period'>.</span><span class='id identifier rubyid_world_currencies'><span class='object_link'><a href="../Mint.html#world_currencies-class_method" title="Mint.world_currencies (method)">world_currencies</a></span></span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span>
|
|
@@ -310,12 +310,12 @@ Manages the registry cache and currency symbol lookups.</p>
|
|
|
310
310
|
31</pre>
|
|
311
311
|
</td>
|
|
312
312
|
<td>
|
|
313
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
313
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency_registry.rb', line 24</span>
|
|
314
314
|
|
|
315
315
|
<span class='kw'>def</span> <span class='id identifier rubyid_currency_symbols'>currency_symbols</span>
|
|
316
316
|
<span class='ivar'>@currency_symbols</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
|
317
317
|
<span class='id identifier rubyid_currencies'>currencies</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span>
|
|
318
|
-
<span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier
|
|
318
|
+
<span class='period'>.</span><span class='id identifier rubyid_reject'>reject</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_symbol'>symbol</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='rbrace'>}</span>
|
|
319
319
|
<span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_currency'>currency</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_symbol'>symbol</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
|
320
320
|
<span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_symbol'>symbol</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='op'>-</span><span class='id identifier rubyid_symbol'>symbol</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span> <span class='op'>-</span><span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_priority'>priority</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
|
321
321
|
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
|
@@ -475,7 +475,7 @@ Manages the registry cache and currency symbol lookups.</p>
|
|
|
475
475
|
55</pre>
|
|
476
476
|
</td>
|
|
477
477
|
<td>
|
|
478
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
478
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/currency_registry.rb', line 42</span>
|
|
479
479
|
|
|
480
480
|
<span class='kw'>def</span> <span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='label'>code:</span><span class='comma'>,</span> <span class='label'>subunit:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='label'>symbol:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
481
481
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Currency code must be String</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_code'>code</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>String</span>
|
|
@@ -501,9 +501,9 @@ Manages the registry cache and currency symbol lookups.</p>
|
|
|
501
501
|
</div>
|
|
502
502
|
|
|
503
503
|
<div id="footer">
|
|
504
|
-
Generated on
|
|
504
|
+
Generated on Sun Jun 14 21:57:01 2026 by
|
|
505
505
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
506
|
-
0.9.44 (ruby-4.0.
|
|
506
|
+
0.9.44 (ruby-4.0.5).
|
|
507
507
|
</div>
|
|
508
508
|
|
|
509
509
|
</div>
|