money 6.5.1 → 6.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/AUTHORS +7 -0
- data/CHANGELOG.md +15 -0
- data/README.md +121 -3
- data/Rakefile +0 -1
- data/config/currency_iso.json +8 -8
- data/lib/money/bank/base.rb +0 -2
- data/lib/money/bank/variable_exchange.rb +80 -85
- data/lib/money/currency.rb +50 -35
- data/lib/money/money/arithmetic.rb +9 -9
- data/lib/money/money/formatting.rb +30 -8
- data/lib/money/money.rb +32 -10
- data/lib/money/rates_store/memory.rb +120 -0
- data/lib/money/version.rb +1 -1
- data/money.gemspec +1 -1
- data/spec/bank/base_spec.rb +62 -58
- data/spec/bank/single_currency_spec.rb +10 -6
- data/spec/bank/variable_exchange_spec.rb +205 -223
- data/spec/currency/loader_spec.rb +20 -0
- data/spec/currency_spec.rb +275 -243
- data/spec/money/arithmetic_spec.rb +16 -34
- data/spec/money/formatting_spec.rb +19 -12
- data/spec/money_spec.rb +86 -97
- data/spec/rates_store/memory_spec.rb +71 -0
- data/spec/spec_helper.rb +10 -0
- metadata +10 -5
data/spec/currency_spec.rb
CHANGED
@@ -2,320 +2,352 @@
|
|
2
2
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
|
-
|
5
|
+
class Money
|
6
|
+
describe Currency do
|
6
7
|
|
7
|
-
|
8
|
+
FOO = '{ "priority": 1, "iso_code": "FOO", "iso_numeric": "840", "name": "United States Dollar", "symbol": "$", "subunit": "Cent", "subunit_to_unit": 450, "symbol_first": true, "html_entity": "$", "decimal_mark": ".", "thousands_separator": ",", "smallest_denomination": 1 }'
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
def register_foo(opts={})
|
11
|
+
foo_attrs = JSON.parse(FOO, :symbolize_names => true)
|
12
|
+
# Pass an array of attribute names to 'skip' to remove them from the 'FOO'
|
13
|
+
# json before registering foo as a currency.
|
14
|
+
Array(opts[:skip]).each { |attr| foo_attrs.delete(attr) }
|
15
|
+
Money::Currency.register(foo_attrs)
|
16
|
+
end
|
12
17
|
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
def unregister_foo
|
19
|
+
Currency.unregister(JSON.parse(FOO, :symbolize_names => true))
|
20
|
+
end
|
16
21
|
|
17
|
-
|
18
|
-
|
19
|
-
|
22
|
+
describe "UnknownCurrency" do
|
23
|
+
it "is a subclass of ArgumentError" do
|
24
|
+
expect(Currency::UnknownCurrency < ArgumentError).to be true
|
25
|
+
end
|
20
26
|
end
|
21
|
-
end
|
22
27
|
|
23
|
-
|
24
|
-
|
25
|
-
|
28
|
+
describe ".find" do
|
29
|
+
before { register_foo }
|
30
|
+
after { unregister_foo }
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
it "returns currency matching given id" do
|
33
|
+
expected = Currency.new(:foo)
|
34
|
+
expect(Currency.find(:foo)).to be expected
|
35
|
+
expect(Currency.find(:FOO)).to be expected
|
36
|
+
expect(Currency.find("foo")).to be expected
|
37
|
+
expect(Currency.find("FOO")).to be expected
|
38
|
+
end
|
34
39
|
|
35
|
-
|
36
|
-
|
40
|
+
it "returns nil unless currency matching given id" do
|
41
|
+
expect(Currency.find("ZZZ")).to be_nil
|
42
|
+
end
|
37
43
|
end
|
38
|
-
end
|
39
44
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
describe ".find_by_iso_numeric" do
|
46
|
+
it "returns currency matching given numeric code" do
|
47
|
+
expect(Currency.find_by_iso_numeric(978)).to eq Currency.new(:eur)
|
48
|
+
expect(Currency.find_by_iso_numeric(208)).not_to eq Currency.new(:eur)
|
49
|
+
expect(Currency.find_by_iso_numeric('840')).to eq Currency.new(:usd)
|
45
50
|
|
46
|
-
|
47
|
-
|
48
|
-
|
51
|
+
class Mock
|
52
|
+
def to_s
|
53
|
+
'208'
|
54
|
+
end
|
49
55
|
end
|
56
|
+
expect(Currency.find_by_iso_numeric(Mock.new)).to eq Currency.new(:dkk)
|
57
|
+
expect(Currency.find_by_iso_numeric(Mock.new)).not_to eq Currency.new(:usd)
|
50
58
|
end
|
51
|
-
expect(Money::Currency.find_by_iso_numeric(Mock.new)).to eq Money::Currency.new(:dkk)
|
52
|
-
expect(Money::Currency.find_by_iso_numeric(Mock.new)).not_to eq Money::Currency.new(:usd)
|
53
|
-
end
|
54
59
|
|
55
|
-
|
56
|
-
|
57
|
-
|
60
|
+
it "returns nil if no currency has the given numeric code" do
|
61
|
+
expect(Currency.find_by_iso_numeric('non iso 4217 numeric code')).to be_nil
|
62
|
+
expect(Currency.find_by_iso_numeric(0)).to be_nil
|
63
|
+
end
|
58
64
|
end
|
59
|
-
end
|
60
65
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
+
describe ".wrap" do
|
67
|
+
it "returns nil if object is nil" do
|
68
|
+
expect(Currency.wrap(nil)).to be_nil
|
69
|
+
expect(Currency.wrap(Currency.new(:usd))).to eq Currency.new(:usd)
|
70
|
+
expect(Currency.wrap(:usd)).to eq Currency.new(:usd)
|
71
|
+
end
|
66
72
|
end
|
67
|
-
end
|
68
73
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
74
|
+
describe ".all" do
|
75
|
+
it "returns an array of currencies" do
|
76
|
+
expect(Currency.all).to include Currency.new(:usd)
|
77
|
+
end
|
78
|
+
it "includes registered currencies" do
|
79
|
+
register_foo
|
80
|
+
expect(Currency.all).to include Currency.new(:foo)
|
81
|
+
unregister_foo
|
82
|
+
end
|
83
|
+
it 'is sorted by priority' do
|
84
|
+
expect(Currency.all.first.priority).to eq 1
|
85
|
+
end
|
86
|
+
it "raises a MissingAttributeError if any currency has no priority" do
|
87
|
+
register_foo(:skip => :priority)
|
88
|
+
|
89
|
+
expect{Money::Currency.all}.to \
|
90
|
+
raise_error(Money::Currency::MissingAttributeError, /foo.*priority/)
|
91
|
+
unregister_foo
|
92
|
+
end
|
80
93
|
end
|
81
|
-
end
|
82
94
|
|
83
95
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
describe ".register" do
|
97
|
+
after { Currency.unregister(iso_code: "XXX") if Currency.find("XXX") }
|
98
|
+
|
99
|
+
it "registers a new currency" do
|
100
|
+
Currency.register(
|
101
|
+
iso_code: "XXX",
|
102
|
+
name: "Golden Doubloon",
|
103
|
+
symbol: "%",
|
104
|
+
subunit_to_unit: 100
|
105
|
+
)
|
106
|
+
new_currency = Currency.find("XXX")
|
107
|
+
expect(new_currency).not_to be_nil
|
108
|
+
expect(new_currency.name).to eq "Golden Doubloon"
|
109
|
+
expect(new_currency.symbol).to eq "%"
|
110
|
+
end
|
99
111
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
112
|
+
specify ":iso_code must be present" do
|
113
|
+
expect {
|
114
|
+
Currency.register(name: "New Currency")
|
115
|
+
}.to raise_error(KeyError)
|
116
|
+
end
|
104
117
|
end
|
105
|
-
end
|
106
118
|
|
107
119
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
120
|
+
describe ".unregister" do
|
121
|
+
it "unregisters a currency" do
|
122
|
+
Currency.register(iso_code: "XXX")
|
123
|
+
expect(Currency.find("XXX")).not_to be_nil # Sanity check
|
124
|
+
Currency.unregister(iso_code: "XXX")
|
125
|
+
expect(Currency.find("XXX")).to be_nil
|
126
|
+
end
|
115
127
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
128
|
+
it "returns true iff the currency existed" do
|
129
|
+
Currency.register(iso_code: "XXX")
|
130
|
+
expect(Currency.unregister(iso_code: "XXX")).to be_truthy
|
131
|
+
expect(Currency.unregister(iso_code: "XXX")).to be_falsey
|
132
|
+
end
|
121
133
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
134
|
+
it "can be passed an ISO code" do
|
135
|
+
Currency.register(iso_code: "XXX")
|
136
|
+
Currency.register(iso_code: "YYZ")
|
137
|
+
# Test with string:
|
138
|
+
Currency.unregister("XXX")
|
139
|
+
expect(Currency.find("XXX")).to be_nil
|
140
|
+
# Test with symbol:
|
141
|
+
Currency.unregister(:yyz)
|
142
|
+
expect(Currency.find(:yyz)).to be_nil
|
143
|
+
end
|
131
144
|
end
|
132
|
-
end
|
133
145
|
|
134
146
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
147
|
+
describe ".each" do
|
148
|
+
it "yields each currency to the block" do
|
149
|
+
expect(Currency).to respond_to(:each)
|
150
|
+
currencies = []
|
151
|
+
Currency.each do |currency|
|
152
|
+
currencies.push(currency)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Don't bother testing every single currency
|
156
|
+
expect(currencies[0]).to eq Currency.all[0]
|
157
|
+
expect(currencies[1]).to eq Currency.all[1]
|
158
|
+
expect(currencies[-1]).to eq Currency.all[-1]
|
141
159
|
end
|
160
|
+
end
|
161
|
+
|
142
162
|
|
143
|
-
|
144
|
-
expect(
|
145
|
-
expect(
|
146
|
-
expect(
|
163
|
+
it "implements Enumerable" do
|
164
|
+
expect(Currency).to respond_to(:all?)
|
165
|
+
expect(Currency).to respond_to(:each_with_index)
|
166
|
+
expect(Currency).to respond_to(:map)
|
167
|
+
expect(Currency).to respond_to(:select)
|
168
|
+
expect(Currency).to respond_to(:reject)
|
147
169
|
end
|
148
|
-
end
|
149
170
|
|
150
171
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
172
|
+
describe "#initialize" do
|
173
|
+
before { Currency.instances.clear }
|
174
|
+
it "lookups data from loaded config" do
|
175
|
+
currency = Currency.new("USD")
|
176
|
+
expect(currency.id).to eq :usd
|
177
|
+
expect(currency.priority).to eq 1
|
178
|
+
expect(currency.iso_code).to eq "USD"
|
179
|
+
expect(currency.iso_numeric).to eq "840"
|
180
|
+
expect(currency.name).to eq "United States Dollar"
|
181
|
+
expect(currency.decimal_mark).to eq "."
|
182
|
+
expect(currency.separator).to eq "."
|
183
|
+
expect(currency.thousands_separator).to eq ","
|
184
|
+
expect(currency.delimiter).to eq ","
|
185
|
+
expect(currency.smallest_denomination).to eq 1
|
186
|
+
end
|
158
187
|
|
188
|
+
it "raises UnknownCurrency with unknown currency" do
|
189
|
+
expect { Currency.new("xxx") }.to raise_error(Currency::UnknownCurrency, /xxx/)
|
190
|
+
end
|
159
191
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
expect(currency.name).to eq "United States Dollar"
|
168
|
-
expect(currency.decimal_mark).to eq "."
|
169
|
-
expect(currency.separator).to eq "."
|
170
|
-
expect(currency.thousands_separator).to eq ","
|
171
|
-
expect(currency.delimiter).to eq ","
|
172
|
-
expect(currency.smallest_denomination).to eq 1
|
173
|
-
end
|
192
|
+
it 'returns old object for the same :key' do
|
193
|
+
expect(Currency.new("USD")).to be(Currency.new("USD"))
|
194
|
+
expect(Currency.new("USD")).to be(Currency.new(:usd))
|
195
|
+
expect(Currency.new("USD")).to be(Currency.new(:USD))
|
196
|
+
expect(Currency.new("USD")).to be(Currency.new('usd'))
|
197
|
+
expect(Currency.new("USD")).to be(Currency.new('Usd'))
|
198
|
+
end
|
174
199
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
end
|
200
|
+
it 'returns new object for the different :key' do
|
201
|
+
expect(Currency.new("USD")).to_not be(Currency.new("EUR"))
|
202
|
+
end
|
179
203
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
204
|
+
it 'is thread safe' do
|
205
|
+
ids = []
|
206
|
+
2.times.map{ Thread.new{ ids << Currency.new("USD").object_id }}.each(&:join)
|
207
|
+
expect(ids.uniq.length).to eq(1)
|
208
|
+
end
|
184
209
|
end
|
185
210
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
abc = Money::Currency.find("ABC")
|
192
|
-
abe = Money::Currency.find("ABE")
|
193
|
-
expect(abd).to be > abc
|
194
|
-
expect(abe).to be > abd
|
195
|
-
Money::Currency.unregister("ABD")
|
196
|
-
Money::Currency.unregister("ABC")
|
197
|
-
Money::Currency.unregister("ABE")
|
198
|
-
end
|
211
|
+
describe "#<=>" do
|
212
|
+
it "compares objects by priority" do
|
213
|
+
expect(Currency.new(:cad)).to be > Currency.new(:usd)
|
214
|
+
expect(Currency.new(:usd)).to be < Currency.new(:eur)
|
215
|
+
end
|
199
216
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
217
|
+
it "compares by id when priority is the same" do
|
218
|
+
Currency.register(iso_code: "ABD", priority: 15)
|
219
|
+
Currency.register(iso_code: "ABC", priority: 15)
|
220
|
+
Currency.register(iso_code: "ABE", priority: 15)
|
221
|
+
abd = Currency.find("ABD")
|
222
|
+
abc = Currency.find("ABC")
|
223
|
+
abe = Currency.find("ABE")
|
224
|
+
expect(abd).to be > abc
|
225
|
+
expect(abe).to be > abd
|
226
|
+
Currency.unregister("ABD")
|
227
|
+
Currency.unregister("ABC")
|
228
|
+
Currency.unregister("ABE")
|
207
229
|
end
|
208
|
-
end
|
209
|
-
end
|
210
230
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
231
|
+
context "when one of the currencies has no 'priority' set" do
|
232
|
+
it "compares by id" do
|
233
|
+
Currency.register(iso_code: "ABD") # No priority
|
234
|
+
abd = Currency.find(:abd)
|
235
|
+
usd = Currency.find(:usd)
|
236
|
+
expect(abd).to be < usd
|
237
|
+
Currency.unregister(iso_code: "ABD")
|
238
|
+
end
|
239
|
+
end
|
215
240
|
end
|
216
241
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
242
|
+
describe "#==" do
|
243
|
+
it "returns true if self === other" do
|
244
|
+
currency = Currency.new(:eur)
|
245
|
+
expect(currency).to eq currency
|
246
|
+
end
|
222
247
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
expect(Money::Currency.new(:eur)).not_to eq 'usd'
|
229
|
-
end
|
248
|
+
it "returns true if the id is equal ignorning case" do
|
249
|
+
expect(Currency.new(:eur)).to eq Currency.new(:eur)
|
250
|
+
expect(Currency.new(:eur)).to eq Currency.new(:EUR)
|
251
|
+
expect(Currency.new(:eur)).not_to eq Currency.new(:usd)
|
252
|
+
end
|
230
253
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
254
|
+
it "allows direct comparison of currencies and symbols/strings" do
|
255
|
+
expect(Currency.new(:eur)).to eq 'eur'
|
256
|
+
expect(Currency.new(:eur)).to eq 'EUR'
|
257
|
+
expect(Currency.new(:eur)).to eq :eur
|
258
|
+
expect(Currency.new(:eur)).to eq :EUR
|
259
|
+
expect(Currency.new(:eur)).not_to eq 'usd'
|
260
|
+
end
|
235
261
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
expect(Money::Currency.new(:eur).eql?(Money::Currency.new(:usd))).to be false
|
262
|
+
it "allows comparison with nil and returns false" do
|
263
|
+
expect(Currency.new(:eur)).not_to be_nil
|
264
|
+
end
|
240
265
|
end
|
241
|
-
end
|
242
266
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
267
|
+
describe "#eql?" do
|
268
|
+
it "returns true if #== returns true" do
|
269
|
+
expect(Currency.new(:eur).eql?(Currency.new(:eur))).to be true
|
270
|
+
expect(Currency.new(:eur).eql?(Currency.new(:usd))).to be false
|
271
|
+
end
|
247
272
|
end
|
248
273
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
274
|
+
describe "#hash" do
|
275
|
+
it "returns the same value for equal objects" do
|
276
|
+
expect(Currency.new(:eur).hash).to eq Currency.new(:eur).hash
|
277
|
+
expect(Currency.new(:eur).hash).not_to eq Currency.new(:usd).hash
|
278
|
+
end
|
254
279
|
|
255
|
-
|
256
|
-
|
257
|
-
|
280
|
+
it "can be used to return the intersection of Currency object arrays" do
|
281
|
+
intersection = [Currency.new(:eur), Currency.new(:usd)] & [Currency.new(:eur)]
|
282
|
+
expect(intersection).to eq [Currency.new(:eur)]
|
283
|
+
end
|
258
284
|
end
|
259
|
-
end
|
260
285
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
286
|
+
describe "#inspect" do
|
287
|
+
it "works as documented" do
|
288
|
+
expect(Currency.new(:usd).inspect).to eq %Q{#<Money::Currency id: usd, priority: 1, symbol_first: true, thousands_separator: ,, html_entity: $, decimal_mark: ., name: United States Dollar, symbol: $, subunit_to_unit: 100, exponent: 2.0, iso_code: USD, iso_numeric: 840, subunit: Cent, smallest_denomination: 1>}
|
289
|
+
end
|
265
290
|
end
|
266
|
-
end
|
267
291
|
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
292
|
+
describe "#to_s" do
|
293
|
+
it "works as documented" do
|
294
|
+
expect(Currency.new(:usd).to_s).to eq("USD")
|
295
|
+
expect(Currency.new(:eur).to_s).to eq("EUR")
|
296
|
+
end
|
272
297
|
end
|
273
|
-
end
|
274
298
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
299
|
+
describe "#to_str" do
|
300
|
+
it "works as documented" do
|
301
|
+
expect(Currency.new(:usd).to_str).to eq("USD")
|
302
|
+
expect(Currency.new(:eur).to_str).to eq("EUR")
|
303
|
+
end
|
279
304
|
end
|
280
|
-
end
|
281
305
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
306
|
+
describe "#to_sym" do
|
307
|
+
it "works as documented" do
|
308
|
+
expect(Currency.new(:usd).to_sym).to eq(:USD)
|
309
|
+
expect(Currency.new(:eur).to_sym).to eq(:EUR)
|
310
|
+
end
|
286
311
|
end
|
287
312
|
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
313
|
+
describe "#to_currency" do
|
314
|
+
it "works as documented" do
|
315
|
+
usd = Currency.new(:usd)
|
316
|
+
expect(usd.to_currency).to eq usd
|
317
|
+
end
|
293
318
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
319
|
+
it "doesn't create new symbols indefinitely" do
|
320
|
+
expect { Currency.new("bogus") }.to raise_exception(Currency::UnknownCurrency)
|
321
|
+
expect(Symbol.all_symbols.map{|s| s.to_s}).not_to include("bogus")
|
322
|
+
end
|
298
323
|
end
|
299
|
-
end
|
300
324
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
325
|
+
describe "#code" do
|
326
|
+
it "works as documented" do
|
327
|
+
expect(Currency.new(:usd).code).to eq "$"
|
328
|
+
expect(Currency.new(:azn).code).to eq "\u20BC"
|
329
|
+
end
|
306
330
|
end
|
307
|
-
end
|
308
331
|
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
332
|
+
describe "#exponent" do
|
333
|
+
it "conforms to iso 4217" do
|
334
|
+
Currency.new(:jpy).exponent == 0
|
335
|
+
Currency.new(:usd).exponent == 2
|
336
|
+
Currency.new(:iqd).exponent == 3
|
337
|
+
end
|
313
338
|
end
|
314
339
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
340
|
+
describe "#decimal_places" do
|
341
|
+
it "proper places for known currency" do
|
342
|
+
Currency.new(:mro).decimal_places == 1
|
343
|
+
Currency.new(:usd).decimal_places == 2
|
344
|
+
end
|
345
|
+
|
346
|
+
it "proper places for custom currency" do
|
347
|
+
register_foo
|
348
|
+
Currency.new(:foo).decimal_places == 3
|
349
|
+
unregister_foo
|
350
|
+
end
|
319
351
|
end
|
320
352
|
end
|
321
353
|
end
|