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
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>
|
|
7
|
+
Module: Mint::RangeStepPatch
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.44
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css">
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css">
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript">
|
|
18
|
+
pathId = "Mint::RangeStepPatch";
|
|
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 (R)</a> »
|
|
42
|
+
<span class='title'><span class='object_link'><a href="../Mint.html" title="Mint (module)">Mint</a></span></span>
|
|
43
|
+
»
|
|
44
|
+
<span class="title">RangeStepPatch</span>
|
|
45
|
+
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div id="search">
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="class_list_link"
|
|
51
|
+
href="../class_list.html">
|
|
52
|
+
|
|
53
|
+
<svg width="24" height="24">
|
|
54
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
|
55
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
|
56
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
|
57
|
+
</svg>
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div id="content"><h1>Module: Mint::RangeStepPatch
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<span class="private note title">Private</span>
|
|
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/mint/dsl/range.rb
|
|
84
|
+
</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<h2>Overview</h2><div class="docstring">
|
|
90
|
+
<div class="discussion">
|
|
91
|
+
<p class="note private">
|
|
92
|
+
<strong>This module is part of a private API.</strong>
|
|
93
|
+
You should avoid using this module if possible, as it may be removed or be changed in the future.
|
|
94
|
+
</p>
|
|
95
|
+
<p>Ruby < 4.0's Range#step calls rb_to_int on non-Numeric step arguments,
|
|
96
|
+
which raises TypeError for Money objects. Ruby 4.0+ uses arithmetic
|
|
97
|
+
iteration (+ / <=>) for non-numeric steps natively, so this patch is
|
|
98
|
+
only needed on older Rubies.</p>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="tags">
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
<h2>
|
|
114
|
+
Instance Method Summary
|
|
115
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
116
|
+
</h2>
|
|
117
|
+
|
|
118
|
+
<ul class="summary">
|
|
119
|
+
|
|
120
|
+
<li class="public ">
|
|
121
|
+
<span class="summary_signature">
|
|
122
|
+
|
|
123
|
+
<a href="#step-instance_method" title="#step (instance method)">#<strong>step</strong>(step_size = nil, &block) ⇒ self, Enumerator </a>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
</span>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
<span class="private note title">private</span>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<span class="summary_desc"><div class='inline'><p>Iterates over the range using a Money step value.</p></div></span>
|
|
138
|
+
|
|
139
|
+
</li>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
</ul>
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
<div id="instance_method_details" class="method_details_list">
|
|
149
|
+
<h2>Instance Method Details</h2>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
<div class="method_details first">
|
|
153
|
+
<h3 class="signature first" id="step-instance_method">
|
|
154
|
+
|
|
155
|
+
#<strong>step</strong>(step_size = nil, &block) ⇒ <tt>self</tt>, <tt>Enumerator</tt>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</h3><div class="docstring">
|
|
162
|
+
<div class="discussion">
|
|
163
|
+
<p class="note private">
|
|
164
|
+
<strong>This method is part of a private API.</strong>
|
|
165
|
+
You should avoid using this method if possible, as it may be removed or be changed in the future.
|
|
166
|
+
</p>
|
|
167
|
+
<p>Iterates over the range using a Money step value.
|
|
168
|
+
Overrides Range#step to handle Mint::Money step sizes on Ruby < 4.0.</p>
|
|
169
|
+
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
<div class="tags">
|
|
173
|
+
<p class="tag_title">Parameters:</p>
|
|
174
|
+
<ul class="param">
|
|
175
|
+
|
|
176
|
+
<li>
|
|
177
|
+
|
|
178
|
+
<span class='name'>step_size</span>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<span class='type'>(<tt><span class='object_link'><a href="Money.html" title="Mint::Money (class)">Mint::Money</a></span></tt>, <tt>nil</tt>)</span>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
—
|
|
188
|
+
<div class='inline'><p>step amount</p></div>
|
|
189
|
+
|
|
190
|
+
</li>
|
|
191
|
+
|
|
192
|
+
</ul>
|
|
193
|
+
|
|
194
|
+
<p class="tag_title">Returns:</p>
|
|
195
|
+
<ul class="return">
|
|
196
|
+
|
|
197
|
+
<li>
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
<span class='type'>(<tt>self</tt>, <tt>Enumerator</tt>)</span>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
—
|
|
205
|
+
<div class='inline'><p>self if block given, Enumerator otherwise</p></div>
|
|
206
|
+
|
|
207
|
+
</li>
|
|
208
|
+
|
|
209
|
+
</ul>
|
|
210
|
+
<p class="tag_title">Raises:</p>
|
|
211
|
+
<ul class="raise">
|
|
212
|
+
|
|
213
|
+
<li>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
<span class='type'>(<tt>TypeError</tt>)</span>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
</li>
|
|
221
|
+
|
|
222
|
+
</ul>
|
|
223
|
+
|
|
224
|
+
</div><table class="source_code">
|
|
225
|
+
<tr>
|
|
226
|
+
<td>
|
|
227
|
+
<pre class="lines">
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
17
|
|
231
|
+
18
|
|
232
|
+
19
|
|
233
|
+
20
|
|
234
|
+
21
|
|
235
|
+
22
|
|
236
|
+
23
|
|
237
|
+
24
|
|
238
|
+
25
|
|
239
|
+
26
|
|
240
|
+
27
|
|
241
|
+
28
|
|
242
|
+
29</pre>
|
|
243
|
+
</td>
|
|
244
|
+
<td>
|
|
245
|
+
<pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/range.rb', line 17</span>
|
|
246
|
+
|
|
247
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_step'>step</span><span class='lparen'>(</span><span class='id identifier rubyid_step_size'>step_size</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
248
|
+
<span class='kw'>return</span> <span class='kw'>super</span> <span class='kw'>unless</span> <span class='id identifier rubyid_step_size'>step_size</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</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="Money.html" title="Mint::Money (class)">Money</a></span></span><span class='rparen'>)</span>
|
|
249
|
+
|
|
250
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>TypeError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>can't iterate from NilClass</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_begin'>begin</span>
|
|
251
|
+
<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'>step can't be 0</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_step_size'>step_size</span><span class='period'>.</span><span class='id identifier rubyid_zero?'>zero?</span>
|
|
252
|
+
|
|
253
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block'>block</span>
|
|
254
|
+
<span class='id identifier rubyid_each_money_step'>each_money_step</span><span class='lparen'>(</span><span class='id identifier rubyid_step_size'>step_size</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
255
|
+
<span class='kw'>self</span>
|
|
256
|
+
<span class='kw'>else</span>
|
|
257
|
+
<span class='const'>Enumerator</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_yielder'>yielder</span><span class='op'>|</span> <span class='id identifier rubyid_each_money_step'>each_money_step</span><span class='lparen'>(</span><span class='id identifier rubyid_step_size'>step_size</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_yielder'>yielder</span> <span class='op'><<</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
|
|
258
|
+
<span class='kw'>end</span>
|
|
259
|
+
<span class='kw'>end</span></pre>
|
|
260
|
+
</td>
|
|
261
|
+
</tr>
|
|
262
|
+
</table>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
<div id="footer">
|
|
270
|
+
Generated on Sun Jun 14 21:57:01 2026 by
|
|
271
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
272
|
+
0.9.44 (ruby-4.0.5).
|
|
273
|
+
</div>
|
|
274
|
+
|
|
275
|
+
</div>
|
|
276
|
+
</body>
|
|
277
|
+
</html>
|
|
@@ -126,9 +126,9 @@
|
|
|
126
126
|
</div>
|
|
127
127
|
|
|
128
128
|
<div id="footer">
|
|
129
|
-
Generated on
|
|
129
|
+
Generated on Sun Jun 14 21:57:01 2026 by
|
|
130
130
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
131
|
-
0.9.44 (ruby-4.0.
|
|
131
|
+
0.9.44 (ruby-4.0.5).
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
</div>
|
data/doc/Mint.html
CHANGED
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
|
|
91
91
|
<dl>
|
|
92
92
|
<dt>Defined in:</dt>
|
|
93
|
-
<dd>lib/minting/mint/
|
|
94
|
-
lib/minting/
|
|
93
|
+
<dd>lib/minting/mint/mint.rb<span class="defines">,<br>
|
|
94
|
+
lib/minting/money/clamp.rb,<br> lib/minting/money/money.rb,<br> lib/minting/mint/dsl/range.rb,<br> lib/minting/money/coercion.rb,<br> lib/minting/mint/dsl/string.rb,<br> lib/minting/mint/dsl/numeric.rb,<br> lib/minting/money/comparable.rb,<br> lib/minting/money/conversion.rb,<br> lib/minting/currency/currency.rb,<br> lib/minting/money/format/to_s.rb,<br> lib/minting/mint/dsl/top_level.rb,<br> lib/minting/mint/parser/parser.rb,<br> lib/minting/money/constructors.rb,<br> lib/minting/mint/parser/separators.rb,<br> lib/minting/money/allocation/split.rb,<br> lib/minting/money/format/formatting.rb,<br> lib/minting/currency/world_currencies.rb,<br> lib/minting/money/arithmetics/methods.rb,<br> lib/minting/currency/currency_registry.rb,<br> lib/minting/money/allocation/allocation.rb,<br> lib/minting/money/arithmetics/operators.rb</span>
|
|
95
95
|
|
|
96
96
|
</dd>
|
|
97
97
|
</dl>
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
<p class="children">
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Mint/CurrencyRegistry.html" title="Mint::CurrencyRegistry (module)">CurrencyRegistry</a></span>
|
|
114
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Mint/CurrencyRegistry.html" title="Mint::CurrencyRegistry (module)">CurrencyRegistry</a></span>, <span class='object_link'><a href="Mint/RangeStepPatch.html" title="Mint::RangeStepPatch (module)">RangeStepPatch</a></span>
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
|
|
218
218
|
|
|
219
219
|
|
|
220
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
|
220
|
+
<span class="summary_desc"><div class='inline'><p>Registers top-level ::Money and ::Currency constants as aliases for Mint's classes.</p></div></span>
|
|
221
221
|
|
|
222
222
|
</li>
|
|
223
223
|
|
|
@@ -359,10 +359,10 @@ or retrieves it directly if already a Currency object.</p>
|
|
|
359
359
|
|
|
360
360
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_currency'>currency</span><span class='lparen'>(</span><span class='id identifier rubyid_currency'>currency</span><span class='rparen'>)</span>
|
|
361
361
|
<span class='kw'>case</span> <span class='id identifier rubyid_currency'>currency</span>
|
|
362
|
-
<span class='kw'>when</span> <span class='
|
|
362
|
+
<span class='kw'>when</span> <span class='const'>NilClass</span> <span class='kw'>then</span> <span class='kw'>nil</span>
|
|
363
363
|
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span></span> <span class='kw'>then</span> <span class='id identifier rubyid_currency'>currency</span>
|
|
364
364
|
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='const'><span class='object_link'><a href="Mint/CurrencyRegistry.html" title="Mint::CurrencyRegistry (module)">CurrencyRegistry</a></span></span><span class='period'>.</span><span class='id identifier rubyid_currencies'><span class='object_link'><a href="Mint/CurrencyRegistry.html#currencies-instance_method" title="Mint::CurrencyRegistry#currencies (method)">currencies</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_currency'>currency</span><span class='rbracket'>]</span>
|
|
365
|
-
<span class='kw'>else</span>
|
|
365
|
+
<span class='kw'>else</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'>"</span><span class='tstring_content'>currency must be [Currency], [String] or nil (</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'>"</span></span>
|
|
366
366
|
<span class='kw'>end</span>
|
|
367
367
|
<span class='kw'>end</span></pre>
|
|
368
368
|
</td>
|
|
@@ -627,24 +627,49 @@ or retrieves it directly if already a Currency object.</p>
|
|
|
627
627
|
|
|
628
628
|
|
|
629
629
|
|
|
630
|
-
</h3><
|
|
630
|
+
</h3><div class="docstring">
|
|
631
|
+
<div class="discussion">
|
|
632
|
+
<p>Registers top-level ::Money and ::Currency constants as aliases for Mint's classes.</p>
|
|
633
|
+
|
|
634
|
+
</div>
|
|
635
|
+
</div>
|
|
636
|
+
<div class="tags">
|
|
637
|
+
|
|
638
|
+
<p class="tag_title">Raises:</p>
|
|
639
|
+
<ul class="raise">
|
|
640
|
+
|
|
641
|
+
<li>
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
<span class='type'>(<tt>NameError</tt>)</span>
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
—
|
|
649
|
+
<div class='inline'><p>if ::Money or ::Currency are already defined and differ</p></div>
|
|
650
|
+
|
|
651
|
+
</li>
|
|
652
|
+
|
|
653
|
+
</ul>
|
|
654
|
+
|
|
655
|
+
</div><table class="source_code">
|
|
631
656
|
<tr>
|
|
632
657
|
<td>
|
|
633
658
|
<pre class="lines">
|
|
634
659
|
|
|
635
660
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
661
|
+
8
|
|
662
|
+
9
|
|
663
|
+
10
|
|
664
|
+
11
|
|
665
|
+
12
|
|
666
|
+
13
|
|
667
|
+
14
|
|
668
|
+
15
|
|
669
|
+
16</pre>
|
|
645
670
|
</td>
|
|
646
671
|
<td>
|
|
647
|
-
<pre class="code"><span class="info file"># File 'lib/minting/mint/dsl.rb', line
|
|
672
|
+
<pre class="code"><span class="info file"># File 'lib/minting/mint/dsl/top_level.rb', line 8</span>
|
|
648
673
|
|
|
649
674
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_use_top_level_constants!'>use_top_level_constants!</span>
|
|
650
675
|
<span class='kw'>if</span> <span class='op'>!</span><span class='kw'>defined?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#Money-constant" title="Money (constant)">Money</a></span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='kw'>defined?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="top-level-namespace.html#Currency-constant" title="Currency (constant)">Currency</a></span></span><span class='rparen'>)</span>
|
|
@@ -713,11 +738,11 @@ or retrieves it directly if already a Currency object.</p>
|
|
|
713
738
|
15</pre>
|
|
714
739
|
</td>
|
|
715
740
|
<td>
|
|
716
|
-
<pre class="code"><span class="info file"># File 'lib/minting/
|
|
741
|
+
<pre class="code"><span class="info file"># File 'lib/minting/currency/world_currencies.rb', line 9</span>
|
|
717
742
|
|
|
718
743
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_world_currencies'>world_currencies</span>
|
|
719
744
|
<span class='ivar'>@world_currencies</span> <span class='op'>||=</span> <span class='kw'>begin</span>
|
|
720
|
-
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'
|
|
745
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>../data</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid___dir__'>__dir__</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>world-currencies.yaml</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
721
746
|
|
|
722
747
|
<span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_entry'>entry</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_entry'>entry</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>code</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Mint/Currency.html#initialize-instance_method" title="Mint::Currency#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_entry'>entry</span><span class='period'>.</span><span class='id identifier rubyid_transform_keys'>transform_keys</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
|
|
723
748
|
<span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span>
|
|
@@ -852,7 +877,7 @@ or retrieves it directly if already a Currency object.</p>
|
|
|
852
877
|
33</pre>
|
|
853
878
|
</td>
|
|
854
879
|
<td>
|
|
855
|
-
<pre class="code"><span class="info file"># File 'lib/minting/mint/parser.rb', line 22</span>
|
|
880
|
+
<pre class="code"><span class="info file"># File 'lib/minting/mint/parser/parser.rb', line 22</span>
|
|
856
881
|
|
|
857
882
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='comma'>,</span> <span class='id identifier rubyid_currency'>currency</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
858
883
|
<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'>input must be a String</span><span class='tstring_end'>'</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
|
@@ -876,9 +901,9 @@ or retrieves it directly if already a Currency object.</p>
|
|
|
876
901
|
</div>
|
|
877
902
|
|
|
878
903
|
<div id="footer">
|
|
879
|
-
Generated on
|
|
904
|
+
Generated on Sun Jun 14 21:57:01 2026 by
|
|
880
905
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
881
|
-
0.9.44 (ruby-4.0.
|
|
906
|
+
0.9.44 (ruby-4.0.5).
|
|
882
907
|
</div>
|
|
883
908
|
|
|
884
909
|
</div>
|
data/doc/Minting.html
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
|
|
117
117
|
</div>
|
|
118
118
|
</dt>
|
|
119
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.
|
|
119
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.7.1</span><span class='tstring_end'>'</span></span></pre></dd>
|
|
120
120
|
|
|
121
121
|
</dl>
|
|
122
122
|
|
|
@@ -132,9 +132,9 @@
|
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
<div id="footer">
|
|
135
|
-
Generated on
|
|
135
|
+
Generated on Sun Jun 14 21:57:01 2026 by
|
|
136
136
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
137
|
-
0.9.44 (ruby-4.0.
|
|
137
|
+
0.9.44 (ruby-4.0.5).
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
140
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -125,6 +125,21 @@
|
|
|
125
125
|
</ul>
|
|
126
126
|
|
|
127
127
|
|
|
128
|
+
<ul id="alpha_R" class="alpha">
|
|
129
|
+
<li class="letter">R</li>
|
|
130
|
+
<ul>
|
|
131
|
+
|
|
132
|
+
<li>
|
|
133
|
+
<span class='object_link'><a href="Mint/RangeStepPatch.html" title="Mint::RangeStepPatch (module)">RangeStepPatch</a></span>
|
|
134
|
+
|
|
135
|
+
<small>(Mint)</small>
|
|
136
|
+
|
|
137
|
+
</li>
|
|
138
|
+
|
|
139
|
+
</ul>
|
|
140
|
+
</ul>
|
|
141
|
+
|
|
142
|
+
|
|
128
143
|
<ul id="alpha_U" class="alpha">
|
|
129
144
|
<li class="letter">U</li>
|
|
130
145
|
<ul>
|
|
@@ -148,9 +163,9 @@
|
|
|
148
163
|
</div>
|
|
149
164
|
|
|
150
165
|
<div id="footer">
|
|
151
|
-
Generated on
|
|
166
|
+
Generated on Sun Jun 14 21:57:00 2026 by
|
|
152
167
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
153
|
-
0.9.44 (ruby-4.0.
|
|
168
|
+
0.9.44 (ruby-4.0.5).
|
|
154
169
|
</div>
|
|
155
170
|
|
|
156
171
|
</div>
|
data/doc/class_list.html
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
<ul id="full_list" class="class">
|
|
48
48
|
<li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
|
|
49
|
-
<li id='object_Mint' class='even'><div class='item' style='padding-left:30px'><a tabindex='0' class='toggle' role='button' aria-label='Mint child nodes' aria-expanded='false' aria-controls='object_Mint'></a> <span class='object_link'><a href="Mint.html" title="Mint (module)">Mint</a></span><small class='search_info'>Top Level Namespace</small></div><div aria-labelledby='object_Mint'><ul><li id='object_Mint::Currency' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span> < Data<small class='search_info'>Mint</small></div></li><li id='object_Mint::CurrencyRegistry' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/CurrencyRegistry.html" title="Mint::CurrencyRegistry (module)">CurrencyRegistry</a></span><small class='search_info'>Mint</small></div></li><li id='object_Mint::Money' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span> < Object<small class='search_info'>Mint</small></div></li><li id='object_Mint::
|
|
49
|
+
<li id='object_Mint' class='even'><div class='item' style='padding-left:30px'><a tabindex='0' class='toggle' role='button' aria-label='Mint child nodes' aria-expanded='false' aria-controls='object_Mint'></a> <span class='object_link'><a href="Mint.html" title="Mint (module)">Mint</a></span><small class='search_info'>Top Level Namespace</small></div><div aria-labelledby='object_Mint'><ul><li id='object_Mint::Currency' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/Currency.html" title="Mint::Currency (class)">Currency</a></span> < Data<small class='search_info'>Mint</small></div></li><li id='object_Mint::CurrencyRegistry' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/CurrencyRegistry.html" title="Mint::CurrencyRegistry (module)">CurrencyRegistry</a></span><small class='search_info'>Mint</small></div></li><li id='object_Mint::Money' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/Money.html" title="Mint::Money (class)">Money</a></span> < Object<small class='search_info'>Mint</small></div></li><li id='object_Mint::RangeStepPatch' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/RangeStepPatch.html" title="Mint::RangeStepPatch (module)">RangeStepPatch</a></span><small class='search_info'>Mint</small></div></li><li id='object_Mint::UnknownCurrency' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Mint/UnknownCurrency.html" title="Mint::UnknownCurrency (class)">UnknownCurrency</a></span> < StandardError<small class='search_info'>Mint</small></div></li></ul></div></li><li id='object_Minting' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Minting.html" title="Minting (module)">Minting</a></span><small class='search_info'>Top Level Namespace</small></div></li>
|
|
50
50
|
|
|
51
51
|
</ul>
|
|
52
52
|
</div>
|