minting 1.7.2 → 1.7.3

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -1
  3. data/doc/Mint/Currency.html +285 -31
  4. data/doc/Mint/Money.html +79 -56
  5. data/doc/Mint/RangeStepPatch.html +1 -1
  6. data/doc/Mint/Registry.html +842 -0
  7. data/doc/Mint/UnknownCurrency.html +1 -1
  8. data/doc/Mint.html +345 -51
  9. data/doc/Minting.html +2 -2
  10. data/doc/_index.html +8 -8
  11. data/doc/agents/api_review-2026-06-15.md +342 -0
  12. data/doc/class_list.html +1 -1
  13. data/doc/file.README.html +13 -2
  14. data/doc/index.html +13 -2
  15. data/doc/method_list.html +100 -36
  16. data/doc/top-level-namespace.html +1 -1
  17. data/lib/minting/currency/currency.rb +31 -0
  18. data/lib/minting/mint/locale_backend.rb +29 -0
  19. data/lib/minting/mint/mint.rb +23 -21
  20. data/lib/minting/mint/parser/parser.rb +3 -7
  21. data/lib/minting/mint/registry/registration.rb +33 -0
  22. data/lib/minting/mint/registry/registry.rb +38 -0
  23. data/lib/minting/mint/registry/symbols.rb +49 -0
  24. data/lib/minting/mint/registry/zeros.rb +18 -0
  25. data/lib/minting/mint.rb +13 -25
  26. data/lib/minting/money/constructors.rb +6 -11
  27. data/lib/minting/money/format/formatting.rb +16 -0
  28. data/lib/minting/money/format/to_s.rb +13 -4
  29. data/lib/minting/money/money.rb +12 -0
  30. data/lib/minting/version.rb +1 -1
  31. metadata +13 -8
  32. data/lib/minting/currency/currency_registry.rb +0 -67
  33. data/lib/minting/currency/world_currencies.rb +0 -16
  34. /data/doc/agents/{AGENTS.md → expired/AGENTS.md} +0 -0
  35. /data/doc/agents/{copilot-instructions.md → expired/copilot-instructions.md} +0 -0
  36. /data/doc/agents/{gemini_gem_evaluation.md → expired/gemini_gem_evaluation.md} +0 -0
  37. /data/doc/agents/{recommendations.md → expired/recommendations.md} +0 -0
  38. /data/doc/agents/{rubocop-issues.md → expired/rubocop-issues.md} +0 -0
data/doc/Mint/Money.html CHANGED
@@ -957,7 +957,7 @@ Uses <code>%&lt;symbol&gt;s</code> for the currency symbol and <code>%&lt;amount
957
957
  <li class="public ">
958
958
  <span class="summary_signature">
959
959
 
960
- <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong>(format: &#39;%&lt;symbol&gt;s%&lt;amount&gt;f&#39;, decimal: &#39;.&#39;, thousand: &#39;,&#39;, width: nil) &#x21d2; String </a>
960
+ <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong>(format: nil, decimal: nil, thousand: nil, width: nil) &#x21d2; String </a>
961
961
 
962
962
 
963
963
 
@@ -1033,12 +1033,12 @@ Uses <code>%&lt;symbol&gt;s</code> for the currency symbol and <code>%&lt;amount
1033
1033
  <pre class="lines">
1034
1034
 
1035
1035
 
1036
- 10
1037
- 11
1038
- 12</pre>
1036
+ 22
1037
+ 23
1038
+ 24</pre>
1039
1039
  </td>
1040
1040
  <td>
1041
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 10</span>
1041
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 22</span>
1042
1042
 
1043
1043
  <span class='kw'>def</span> <span class='id identifier rubyid_amount'>amount</span>
1044
1044
  <span class='ivar'>@amount</span>
@@ -1074,12 +1074,12 @@ Uses <code>%&lt;symbol&gt;s</code> for the currency symbol and <code>%&lt;amount
1074
1074
  <pre class="lines">
1075
1075
 
1076
1076
 
1077
- 10
1078
- 11
1079
- 12</pre>
1077
+ 22
1078
+ 23
1079
+ 24</pre>
1080
1080
  </td>
1081
1081
  <td>
1082
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 10</span>
1082
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 22</span>
1083
1083
 
1084
1084
  <span class='kw'>def</span> <span class='id identifier rubyid_currency'>currency</span>
1085
1085
  <span class='ivar'>@currency</span>
@@ -1183,10 +1183,10 @@ Uses <code>%&lt;symbol&gt;s</code> for the currency symbol and <code>%&lt;amount
1183
1183
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create'>create</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>
1184
1184
  <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'>amount must be Numeric</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_amount'>amount</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Numeric</span><span class='rparen'>)</span>
1185
1185
 
1186
- <span class='id identifier rubyid_checked_currency'>checked_currency</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_currency'><span class='object_link'><a href="../Mint.html#currency-class_method" title="Mint.currency (method)">currency</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
1187
- <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 not found (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_currency'>currency</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_checked_currency'>checked_currency</span>
1186
+ <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Currency.html" title="Mint::Currency (class)">Currency</a></span></span><span class='period'>.</span><span class='id identifier rubyid_resolve!'><span class='object_link'><a href="Currency.html#resolve!-class_method" title="Mint::Currency.resolve! (method)">resolve!</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
1187
+ <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>
1188
1188
 
1189
- <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_checked_currency'>checked_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><span class='comma'>,</span> <span class='id identifier rubyid_checked_currency'>checked_currency</span><span class='rparen'>)</span>
1189
+ <span class='id identifier rubyid_amount'>amount</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</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_zero'><span class='object_link'><a href="../Mint.html#zero-class_method" title="Mint.zero (method)">zero</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span> <span class='op'>:</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>
1190
1190
  <span class='kw'>end</span></pre>
1191
1191
  </td>
1192
1192
  </tr>
@@ -1312,9 +1312,7 @@ is not registered</p></div>
1312
1312
  40
1313
1313
  41
1314
1314
  42
1315
- 43
1316
- 44
1317
- 45</pre>
1315
+ 43</pre>
1318
1316
  </td>
1319
1317
  <td>
1320
1318
  <pre class="code"><span class="info file"># File 'lib/minting/money/constructors.rb', line 37</span>
@@ -1322,11 +1320,9 @@ is not registered</p></div>
1322
1320
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_from_fractional'>from_fractional</span><span class='lparen'>(</span><span class='id identifier rubyid_fractional'>fractional</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
1323
1321
  <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'>fractional must be an Integer</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_fractional'>fractional</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Integer</span><span class='rparen'>)</span>
1324
1322
 
1325
- <span class='id identifier rubyid_checked_currency'>checked_currency</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_currency'><span class='object_link'><a href="../Mint.html#currency-class_method" title="Mint.currency (method)">currency</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
1326
- <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 not found (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_currency'>currency</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_checked_currency'>checked_currency</span>
1327
-
1328
- <span class='id identifier rubyid_amount'>amount</span> <span class='op'>=</span> <span class='const'>Rational</span><span class='lparen'>(</span><span class='id identifier rubyid_fractional'>fractional</span><span class='comma'>,</span> <span class='id identifier rubyid_checked_currency'>checked_currency</span><span class='period'>.</span><span class='id identifier rubyid_fractional_multiplier'>fractional_multiplier</span><span class='rparen'>)</span>
1329
- <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_checked_currency'>checked_currency</span><span class='rparen'>)</span>
1323
+ <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Currency.html" title="Mint::Currency (class)">Currency</a></span></span><span class='period'>.</span><span class='id identifier rubyid_resolve!'><span class='object_link'><a href="Currency.html#resolve!-class_method" title="Mint::Currency.resolve! (method)">resolve!</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
1324
+ <span class='id identifier rubyid_amount'>amount</span> <span class='op'>=</span> <span class='const'>Rational</span><span class='lparen'>(</span><span class='id identifier rubyid_fractional'>fractional</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_fractional_multiplier'>fractional_multiplier</span><span class='rparen'>)</span>
1325
+ <span class='id identifier rubyid_amount'>amount</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</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_zero'><span class='object_link'><a href="../Mint.html#zero-class_method" title="Mint.zero (method)">zero</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span> <span class='op'>:</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>
1330
1326
  <span class='kw'>end</span></pre>
1331
1327
  </td>
1332
1328
  </tr>
@@ -2460,10 +2456,10 @@ This enables expressions like <code>5 * money</code> where <code>5</code> is a N
2460
2456
  <pre class="lines">
2461
2457
 
2462
2458
 
2463
- 17</pre>
2459
+ 29</pre>
2464
2460
  </td>
2465
2461
  <td>
2466
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 17</span>
2462
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 29</span>
2467
2463
 
2468
2464
  <span class='kw'>def</span> <span class='id identifier rubyid_currency_code'>currency_code</span> <span class='op'>=</span> <span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span></pre>
2469
2465
  </td>
@@ -2579,10 +2575,10 @@ For example, cents for USD (subunit 2), yen for JPY (subunit 0), fils for IQD (s
2579
2575
  <pre class="lines">
2580
2576
 
2581
2577
 
2582
- 27</pre>
2578
+ 39</pre>
2583
2579
  </td>
2584
2580
  <td>
2585
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 27</span>
2581
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 39</span>
2586
2582
 
2587
2583
  <span class='kw'>def</span> <span class='id identifier rubyid_fractional'>fractional</span> <span class='op'>=</span> <span class='lparen'>(</span><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_fractional_multiplier'>fractional_multiplier</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span></pre>
2588
2584
  </td>
@@ -2630,10 +2626,10 @@ For example, cents for USD (subunit 2), yen for JPY (subunit 0), fils for IQD (s
2630
2626
  <pre class="lines">
2631
2627
 
2632
2628
 
2633
- 32</pre>
2629
+ 44</pre>
2634
2630
  </td>
2635
2631
  <td>
2636
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 32</span>
2632
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 44</span>
2637
2633
 
2638
2634
  <span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbracket'>[</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='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</span></pre>
2639
2635
  </td>
@@ -2681,12 +2677,12 @@ For example, cents for USD (subunit 2), yen for JPY (subunit 0), fils for IQD (s
2681
2677
  <pre class="lines">
2682
2678
 
2683
2679
 
2684
- 37
2685
- 38
2686
- 39</pre>
2680
+ 49
2681
+ 50
2682
+ 51</pre>
2687
2683
  </td>
2688
2684
  <td>
2689
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 37</span>
2685
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 49</span>
2690
2686
 
2691
2687
  <span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
2692
2688
  <span class='const'>Kernel</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_currency_code'>currency_code</span><span class='embexpr_end'>}</span><span class='tstring_content'> %0.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_currency'>currency</span><span class='period'>.</span><span class='id identifier rubyid_subunit'>subunit</span><span class='embexpr_end'>}</span><span class='tstring_content'>f]</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_amount'>amount</span>
@@ -2766,17 +2762,31 @@ while preserving immutability.</p>
2766
2762
  <pre class="lines">
2767
2763
 
2768
2764
 
2765
+ 55
2766
+ 56
2769
2767
  57
2770
2768
  58
2771
2769
  59
2772
- 60</pre>
2770
+ 60
2771
+ 61
2772
+ 62
2773
+ 63
2774
+ 64
2775
+ 65</pre>
2773
2776
  </td>
2774
2777
  <td>
2775
- <pre class="code"><span class="info file"># File 'lib/minting/money/constructors.rb', line 57</span>
2778
+ <pre class="code"><span class="info file"># File 'lib/minting/money/constructors.rb', line 55</span>
2776
2779
 
2777
2780
  <span class='kw'>def</span> <span class='id identifier rubyid_mint'>mint</span><span class='lparen'>(</span><span class='id identifier rubyid_new_amount'>new_amount</span><span class='rparen'>)</span>
2778
2781
  <span class='id identifier rubyid_new_amount'>new_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_new_amount'>new_amount</span><span class='rparen'>)</span>
2779
- <span class='id identifier rubyid_new_amount'>new_amount</span> <span class='op'>==</span> <span class='id identifier rubyid_amount'>amount</span> <span class='op'>?</span> <span class='kw'>self</span> <span class='op'>:</span> <span class='const'><span class='object_link'><a href="" 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_new_amount'>new_amount</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
2782
+
2783
+ <span class='kw'>if</span> <span class='id identifier rubyid_new_amount'>new_amount</span> <span class='op'>==</span> <span class='id identifier rubyid_amount'>amount</span>
2784
+ <span class='kw'>self</span>
2785
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_new_amount'>new_amount</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
2786
+ <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_zero'><span class='object_link'><a href="../Mint.html#zero-class_method" title="Mint.zero (method)">zero</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
2787
+ <span class='kw'>else</span>
2788
+ <span class='const'><span class='object_link'><a href="" 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_new_amount'>new_amount</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
2789
+ <span class='kw'>end</span>
2780
2790
  <span class='kw'>end</span></pre>
2781
2791
  </td>
2782
2792
  </tr>
@@ -2994,10 +3004,10 @@ while preserving immutability.</p>
2994
3004
  <pre class="lines">
2995
3005
 
2996
3006
 
2997
- 45</pre>
3007
+ 57</pre>
2998
3008
  </td>
2999
3009
  <td>
3000
- <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 45</span>
3010
+ <pre class="code"><span class="info file"># File 'lib/minting/money/money.rb', line 57</span>
3001
3011
 
3002
3012
  <span class='kw'>def</span> <span class='id identifier rubyid_same_currency?'>same_currency?</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_currency'>currency</span> <span class='op'>==</span> <span class='id identifier rubyid_currency'>currency</span></pre>
3003
3013
  </td>
@@ -3596,7 +3606,7 @@ Highly optimized to run without external dependencies.</p>
3596
3606
  <div class="method_details ">
3597
3607
  <h3 class="signature " id="to_s-instance_method">
3598
3608
 
3599
- #<strong>to_s</strong>(format: &#39;%&lt;symbol&gt;s%&lt;amount&gt;f&#39;, decimal: &#39;.&#39;, thousand: &#39;,&#39;, width: nil) &#x21d2; <tt>String</tt>
3609
+ #<strong>to_s</strong>(format: nil, decimal: nil, thousand: nil, width: nil) &#x21d2; <tt>String</tt>
3600
3610
 
3601
3611
 
3602
3612
 
@@ -3642,6 +3652,11 @@ Highly optimized to run without external dependencies.</p>
3642
3652
  <pre class="example code"><code><span class='id identifier rubyid_money'>money</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='label'>format:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%&lt;amount&gt;10.2f</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; &quot; 1234.56&quot;
3643
3653
  </span><span class='id identifier rubyid_money'>money</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='label'>format:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>%&lt;symbol&gt;s%&lt;amount&gt;010.2f</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='comment'>#=&gt; &quot;$0001234.56&quot;</span></code></pre>
3644
3654
 
3655
+
3656
+ <h5 class="example_title"><div class='inline'><p>Locale-aware formatting (with Mint.locale_backend set)</p></div></h5>
3657
+
3658
+ <pre class="example code"><code><span class='id identifier rubyid_money'>money</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='comment'># decimal and thousand come from locale_backend</span></code></pre>
3659
+
3645
3660
  </div>
3646
3661
  <p class="tag_title">Parameters:</p>
3647
3662
  <ul class="param">
@@ -3651,10 +3666,10 @@ Highly optimized to run without external dependencies.</p>
3651
3666
  <span class='name'>format</span>
3652
3667
 
3653
3668
 
3654
- <span class='type'>(<tt>String</tt>, <tt>Hash</tt>)</span>
3669
+ <span class='type'>(<tt>String</tt>, <tt>Hash</tt>, <tt>nil</tt>)</span>
3655
3670
 
3656
3671
 
3657
- <em class="default">(defaults to: <tt>&#39;%&lt;symbol&gt;s%&lt;amount&gt;f&#39;</tt>)</em>
3672
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
3658
3673
 
3659
3674
 
3660
3675
  &mdash;
@@ -3666,7 +3681,9 @@ is convenient for sign-aware formats such as accounting parentheses:</p>
3666
3681
  </code></pre>
3667
3682
  <p>Missing keys fall back to the module default, so a Hash with only
3668
3683
  :negative will still format positives sensibly. The valid keys are
3669
- :positive, :negative, :zero; anything else raises ArgumentError.</p></div>
3684
+ :positive, :negative, :zero; anything else raises ArgumentError.
3685
+ When <code>nil</code>, falls back to <code>Mint.locale_backend</code> if set, otherwise
3686
+ <code>&quot;%&lt;symbol&gt;s%&lt;amount&gt;f&quot;</code>.</p></div>
3670
3687
 
3671
3688
  </li>
3672
3689
 
@@ -3675,14 +3692,15 @@ is convenient for sign-aware formats such as accounting parentheses:</p>
3675
3692
  <span class='name'>thousand</span>
3676
3693
 
3677
3694
 
3678
- <span class='type'>(<tt>String</tt>, <tt>false</tt>)</span>
3695
+ <span class='type'>(<tt>String</tt>, <tt>false</tt>, <tt>nil</tt>)</span>
3679
3696
 
3680
3697
 
3681
- <em class="default">(defaults to: <tt>&#39;,&#39;</tt>)</em>
3698
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
3682
3699
 
3683
3700
 
3684
3701
  &mdash;
3685
- <div class='inline'><p>Thousands delimiter (e.g., ',' for 1,000)</p></div>
3702
+ <div class='inline'><p>Thousands delimiter (e.g., ',' for 1,000).
3703
+ When <code>nil</code>, falls back to <code>Mint.locale_backend</code> if set, otherwise <code>&quot;,&quot;</code>.</p></div>
3686
3704
 
3687
3705
  </li>
3688
3706
 
@@ -3691,14 +3709,15 @@ is convenient for sign-aware formats such as accounting parentheses:</p>
3691
3709
  <span class='name'>decimal</span>
3692
3710
 
3693
3711
 
3694
- <span class='type'>(<tt>String</tt>)</span>
3712
+ <span class='type'>(<tt>String</tt>, <tt>nil</tt>)</span>
3695
3713
 
3696
3714
 
3697
- <em class="default">(defaults to: <tt>&#39;.&#39;</tt>)</em>
3715
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
3698
3716
 
3699
3717
 
3700
3718
  &mdash;
3701
- <div class='inline'><p>Decimal separator (e.g., '.' or ',')</p></div>
3719
+ <div class='inline'><p>Decimal separator (e.g., '.' or ',').
3720
+ When <code>nil</code>, falls back to <code>Mint.locale_backend</code> if set, otherwise <code>&quot;.&quot;</code>.</p></div>
3702
3721
 
3703
3722
  </li>
3704
3723
 
@@ -3744,13 +3763,6 @@ is empty, or the Hash contains an unrecognised key.</p></div>
3744
3763
  <pre class="lines">
3745
3764
 
3746
3765
 
3747
- 46
3748
- 47
3749
- 48
3750
- 49
3751
- 50
3752
- 51
3753
- 52
3754
3766
  53
3755
3767
  54
3756
3768
  55
@@ -3763,12 +3775,23 @@ is empty, or the Hash contains an unrecognised key.</p></div>
3763
3775
  62
3764
3776
  63
3765
3777
  64
3766
- 65</pre>
3778
+ 65
3779
+ 66
3780
+ 67
3781
+ 68
3782
+ 69
3783
+ 70
3784
+ 71
3785
+ 72
3786
+ 73
3787
+ 74</pre>
3767
3788
  </td>
3768
3789
  <td>
3769
- <pre class="code"><span class="info file"># File 'lib/minting/money/format/to_s.rb', line 46</span>
3790
+ <pre class="code"><span class="info file"># File 'lib/minting/money/format/to_s.rb', line 53</span>
3791
+
3792
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='label'>format:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>decimal:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>thousand:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>width:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3793
+ <span class='id identifier rubyid_format'>format</span><span class='comma'>,</span> <span class='id identifier rubyid_decimal'>decimal</span><span class='comma'>,</span> <span class='id identifier rubyid_thousand'>thousand</span> <span class='op'>=</span> <span class='id identifier rubyid_resolve_locale_for'>resolve_locale_for</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='comma'>,</span> <span class='id identifier rubyid_decimal'>decimal</span><span class='comma'>,</span> <span class='id identifier rubyid_thousand'>thousand</span><span class='rparen'>)</span>
3770
3794
 
3771
- <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='label'>format:</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><span class='comma'>,</span> <span class='label'>decimal:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>thousand:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>,</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>width:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
3772
3795
  <span class='kw'>case</span> <span class='id identifier rubyid_format'>format</span>
3773
3796
  <span class='kw'>when</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <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'>format must not be empty</span><span class='tstring_end'>&#39;</span></span>
3774
3797
  <span class='kw'>when</span> <span class='const'>Hash</span> <span class='kw'>then</span> <span class='id identifier rubyid_validate_format_hash'>validate_format_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
@@ -3849,7 +3872,7 @@ is empty, or the Hash contains an unrecognised key.</p></div>
3849
3872
  </div>
3850
3873
 
3851
3874
  <div id="footer">
3852
- Generated on Sun Jun 14 21:57:01 2026 by
3875
+ Generated on Mon Jun 15 19:57:57 2026 by
3853
3876
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
3854
3877
  0.9.44 (ruby-4.0.5).
3855
3878
  </div>
@@ -267,7 +267,7 @@ Overrides Range#step to handle Mint::Money step sizes on Ruby &lt; 4.0.</p>
267
267
  </div>
268
268
 
269
269
  <div id="footer">
270
- Generated on Sun Jun 14 21:57:01 2026 by
270
+ Generated on Mon Jun 15 19:57:57 2026 by
271
271
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
272
272
  0.9.44 (ruby-4.0.5).
273
273
  </div>