mroch-BigMoney 0.1.2 → 0.2.1

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.
@@ -1,3 +1,7 @@
1
+ === 0.1.2 / 2008-08-09
2
+
3
+ * Minor documentation tweaks
4
+
1
5
  === 0.1.1 / 2008-06-22
2
6
 
3
7
  * Fixed documentation
@@ -7,4 +7,14 @@ bigmoney.gemspec
7
7
  lib/big_money.rb
8
8
  lib/big_money/big_money.rb
9
9
  lib/big_money/core_extensions.rb
10
+ lib/big_money/currency.rb
11
+ lib/big_money/currency/iso4217.rb
12
+ lib/big_money/exchange.rb
13
+ lib/big_money/exchange/yahoo.rb
14
+ rakelib/cultivate.rake
15
+ rakelib/iso4217.rake
16
+ rakelib/iso4217.rb
17
+ rakelib/iso4217.rb.erb
10
18
  test/test_big_money.rb
19
+ test/test_currency.rb
20
+ test/test_exchange.rb
data/Rakefile CHANGED
@@ -4,8 +4,13 @@ require 'rubygems'
4
4
  require 'hoe'
5
5
  require './lib/big_money.rb'
6
6
 
7
- Hoe.new('BigMoney', BigMoney::VERSION) do |p|
7
+ Hoe.new('big_money', BigMoney::VERSION) do |p|
8
8
  p.developer('Marshall Roch', 'mroch@cmu.edu')
9
9
  end
10
10
 
11
+ # Load extra rake tasks.
12
+ tasks_path = File.join(File.dirname(__FILE__), 'rakelib')
13
+ rake_files = Dir["#{tasks_path}/*.rake"]
14
+ rake_files.each{|rake_file| load rake_file}
15
+
11
16
  # vim: syntax=Ruby
@@ -1,27 +1,32 @@
1
1
  Gem::Specification.new do |s|
2
- s.name = "BigMoney"
3
- s.version = "0.1.2"
4
- s.date = "2008-08-09"
5
- s.summary = "Represents an amount of money in a particular currency."
6
- s.email = "mroch@cmu.edu"
7
- s.homepage = "http://github.com/mroch/bigmoney"
8
- s.description = "Represents an amount of money in a particular currency. Backed by BigDecimal, so is safe from float rounding errors."
9
- s.has_rdoc = false
2
+ s.name = %q{BigMoney}
3
+ s.version = "0.2.1"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
6
  s.authors = ["Marshall Roch"]
11
- s.files = [
12
- "bigmoney.gemspec",
13
- "History.txt",
14
- "Manifest.txt",
15
- "LICENSE.txt",
16
- "Rakefile",
17
- "README.txt",
18
- "lib/big_money.rb",
19
- "lib/big_money/big_money.rb",
20
- "lib/big_money/core_extensions.rb",
21
- "test/test_big_money.rb"
22
- ]
23
- s.test_files = ["test/test_big_money.rb"]
24
- # s.rdoc_options = ["--main", "README.txt"]
25
- # s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
26
- # s.add_dependency("mime-types", ["> 0.0.0"])
7
+ s.date = %q{2008-10-20}
8
+ s.description = %q{Represents an amount of money in a particular currency. Backed by BigDecimal, so is safe from float rounding errors.}
9
+ s.email = ["mroch@cmu.edu"]
10
+ s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.txt"]
11
+ s.files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.txt", "Rakefile", "bigmoney.gemspec", "lib/big_money.rb", "lib/big_money/big_money.rb", "lib/big_money/core_extensions.rb", "lib/big_money/currency.rb", "lib/big_money/currency/iso4217.rb", "lib/big_money/exchange.rb", "lib/big_money/exchange/yahoo.rb", "rakelib/cultivate.rake", "rakelib/iso4217.rake", "rakelib/iso4217.rb", "rakelib/iso4217.rb.erb", "test/test_big_money.rb", "test/test_currency.rb", "test/test_exchange.rb"]
12
+ s.has_rdoc = true
13
+ s.rdoc_options = ["--main", "README.txt"]
14
+ s.require_paths = ["lib"]
15
+ s.rubyforge_project = %q{bigmoney}
16
+ s.rubygems_version = %q{1.2.0}
17
+ s.summary = %q{Represents an amount of money in a particular currency}
18
+ s.test_files = ["test/test_big_money.rb", "test/test_currency.rb", "test/test_exchange.rb"]
19
+
20
+ if s.respond_to? :specification_version then
21
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
+ s.specification_version = 2
23
+
24
+ if current_version >= 3 then
25
+ s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
26
+ else
27
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
28
+ end
29
+ else
30
+ s.add_dependency(%q<hoe>, [">= 1.8.0"])
31
+ end
27
32
  end
@@ -1,5 +1,9 @@
1
1
  dir = File.dirname(__FILE__)
2
2
  $LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
3
3
 
4
+ require 'big_money/currency'
5
+ require 'big_money/currency/iso4217' # TODO: Optional?
6
+ require 'big_money/exchange'
7
+ require 'big_money/exchange/yahoo' # TODO: Optional?
4
8
  require 'big_money/big_money'
5
- require 'big_money/core_extensions'
9
+ require 'big_money/core_extensions'
@@ -1,51 +1,53 @@
1
1
  require 'bigdecimal'
2
2
 
3
3
  class BigMoney
4
- VERSION = '0.1.1'
5
-
6
- class MoneyError < StandardError ; end
7
- class UncomparableCurrency < MoneyError ; end
8
-
9
- @@default_currency = :USD
4
+ VERSION = '0.2.1'
5
+
6
+ class MoneyError < StandardError; end
7
+ class UnknownCurrency < MoneyError; end
8
+ class UncomparableCurrency < MoneyError; end
9
+
10
+ @@default_currency = Currency::USD.instance
10
11
  def self.default_currency ; @@default_currency ; end
11
12
  def self.default_currency=(c) ; @@default_currency = c ; end
12
13
  def default_currency ; self.class.default_currency ; end
13
14
  def default_currency=(c) ; self.class.default_currency = c ; end
14
-
15
+
15
16
  attr_reader :amount, :currency
16
-
17
+
17
18
  def initialize(amount, currency = nil)
18
- @amount = amount.class == BigDecimal ? amount : BigDecimal.new(amount.to_s)
19
- @currency = currency || self.default_currency
19
+ @amount = amount.class == BigDecimal ? amount : BigDecimal.new(amount.to_s)
20
+ @currency = Currency.parse(currency || default_currency) or \
21
+ raise UnknownCurrency, "Cannot parse '#{currency}'."
20
22
  end
21
-
23
+
22
24
  def eql?(other_money)
23
25
  currency == other_money.currency && amount == other_money.amount
24
26
  end
25
-
27
+
26
28
  def ==(other_money)
27
29
  eql?(other_money)
28
30
  end
29
-
31
+
30
32
  def <=>(other_money)
31
33
  raise UncomparableCurrency, "Cannot compare #{currency} to #{other_money.currency}" \
32
34
  unless currency == other_money.currency
33
-
35
+
34
36
  amount <=> other_money.amount
35
37
  end
36
-
38
+
37
39
  def -@
38
40
  BigMoney.new(-amount, currency)
39
41
  end
40
-
42
+
41
43
  def +(val)
42
44
  op(:+, val)
43
45
  end
44
-
46
+
45
47
  def -(val)
46
48
  op(:-, val)
47
49
  end
48
-
50
+
49
51
  def *(val)
50
52
  op(:*, val)
51
53
  end
@@ -53,23 +55,38 @@ class BigMoney
53
55
  def /(val)
54
56
  op(:/, val)
55
57
  end
56
-
58
+
57
59
  def to_s
58
- to_formatted_s('%.2f')
60
+ to_formatted_s("%.#{currency.offset}f")
59
61
  end
60
-
62
+
61
63
  def to_formatted_s(format)
62
- format.sub(/%s/, currency.to_s.upcase) % amount
64
+ format.sub(/%s/, currency.code) % amount
63
65
  end
64
-
66
+
65
67
  def to_i
66
68
  amount.to_i
67
69
  end
68
-
70
+
69
71
  def to_f
70
72
  amount.to_f
71
73
  end
72
74
 
75
+ # Exchange to a new Currency.
76
+ #
77
+ # BigMoney.new(12.50, :aud).exchange(:usd)
78
+ def exchange(to)
79
+ ex = amount * Exchange.rate(currency, to)
80
+ BigMoney.new(ex, to)
81
+ end
82
+
83
+ # Short form BigMoney::Currency.parse(code) to save some typing.
84
+ #
85
+ # BigMoney.currency(:usd) #=> BigMoney::Currency.parse(:usd)
86
+ def self.currency(code)
87
+ Currency.parse(code)
88
+ end
89
+
73
90
  private
74
91
  def op(s, val)
75
92
  if val.class == BigMoney
@@ -0,0 +1,75 @@
1
+ require 'singleton'
2
+
3
+ class BigMoney
4
+
5
+ # Currency singleton objects.
6
+ #
7
+ # By default ISO4217 currency codes are known and registered with the factory. You'll need to sublcass Currency in
8
+ # order to use non ISO4217 currencies.
9
+ #
10
+ # class WOW < BigMoney::Currency
11
+ # self.name = 'World of Warcraft Gold'
12
+ # self.code = 'WOW'
13
+ # self.offset = 4
14
+ # end
15
+ #
16
+ # bm = BigMoney.new(12.5020, :wow) # Would throw an UnknownCurrency error without the subclass.
17
+ # bm.to_s #=> 'WOW 12.5000' # 12 gold, 50 silver, 20 copper
18
+ #
19
+ # Currency singletons are comparable against itself, an upper or lowercase string or symbol of the currency code.
20
+ #
21
+ # gold = WOW.instance
22
+ # gold == :wow #=> true
23
+ # gold == 'wow' #=> true
24
+ class Currency
25
+ include Comparable
26
+ include Singleton
27
+
28
+ # Compare against another currency object, an upper or lowercase string or symbol of the currecy code.
29
+ def <=>(value)
30
+ code.to_s <=> value.to_s.upcase
31
+ end
32
+
33
+ # English currency name.
34
+ def name
35
+ self.class.name
36
+ end
37
+
38
+ # ISO 4217 3 letter currency code.
39
+ def code
40
+ self.class.code
41
+ end
42
+
43
+ # Number of decimal places to display by default.
44
+ def offset
45
+ self.class.offset
46
+ end
47
+
48
+ # Currency code.
49
+ def to_s
50
+ code.to_s
51
+ end
52
+
53
+ class << self
54
+ attr_accessor :name, :code, :offset
55
+
56
+ @@currencies = []
57
+ def inherited(currency) #:nodoc:
58
+ super
59
+ @@currencies << currency
60
+ end
61
+
62
+ # All currencies. By default all current ISO4217 currencies.
63
+ def all
64
+ @@currencies.uniq
65
+ end
66
+
67
+ # Parse a currency instance, an upper or lowercase string or symbol of the currency code into a currency
68
+ # object.
69
+ def parse(value)
70
+ all.find{|c| c.code == value.to_s.upcase}.instance rescue nil
71
+ end
72
+ end
73
+ end # Currency
74
+
75
+ end # Money
@@ -0,0 +1,1043 @@
1
+ class BigMoney
2
+ class Currency
3
+ class AED < Currency #:nodoc:
4
+ self.name = %q{United Arab Emirates dirham}
5
+ self.code = %q{AED}
6
+ self.offset = 2
7
+ end
8
+
9
+ class AFN < Currency #:nodoc:
10
+ self.name = %q{Afghani}
11
+ self.code = %q{AFN}
12
+ self.offset = 2
13
+ end
14
+
15
+ class ALL < Currency #:nodoc:
16
+ self.name = %q{Lek}
17
+ self.code = %q{ALL}
18
+ self.offset = 2
19
+ end
20
+
21
+ class AMD < Currency #:nodoc:
22
+ self.name = %q{Armenian dram}
23
+ self.code = %q{AMD}
24
+ self.offset = 2
25
+ end
26
+
27
+ class ANG < Currency #:nodoc:
28
+ self.name = %q{Netherlands Antillean guilder}
29
+ self.code = %q{ANG}
30
+ self.offset = 2
31
+ end
32
+
33
+ class AOA < Currency #:nodoc:
34
+ self.name = %q{Kwanza}
35
+ self.code = %q{AOA}
36
+ self.offset = 2
37
+ end
38
+
39
+ class ARS < Currency #:nodoc:
40
+ self.name = %q{Argentine peso}
41
+ self.code = %q{ARS}
42
+ self.offset = 2
43
+ end
44
+
45
+ class AUD < Currency #:nodoc:
46
+ self.name = %q{Australian dollar}
47
+ self.code = %q{AUD}
48
+ self.offset = 2
49
+ end
50
+
51
+ class AWG < Currency #:nodoc:
52
+ self.name = %q{Aruban guilder}
53
+ self.code = %q{AWG}
54
+ self.offset = 2
55
+ end
56
+
57
+ class AZN < Currency #:nodoc:
58
+ self.name = %q{Azerbaijanian manat}
59
+ self.code = %q{AZN}
60
+ self.offset = 2
61
+ end
62
+
63
+ class BAM < Currency #:nodoc:
64
+ self.name = %q{Convertible marks}
65
+ self.code = %q{BAM}
66
+ self.offset = 2
67
+ end
68
+
69
+ class BBD < Currency #:nodoc:
70
+ self.name = %q{Barbados dollar}
71
+ self.code = %q{BBD}
72
+ self.offset = 2
73
+ end
74
+
75
+ class BDT < Currency #:nodoc:
76
+ self.name = %q{Bangladeshi taka}
77
+ self.code = %q{BDT}
78
+ self.offset = 2
79
+ end
80
+
81
+ class BGN < Currency #:nodoc:
82
+ self.name = %q{Bulgarian lev}
83
+ self.code = %q{BGN}
84
+ self.offset = 2
85
+ end
86
+
87
+ class BHD < Currency #:nodoc:
88
+ self.name = %q{Bahraini dinar}
89
+ self.code = %q{BHD}
90
+ self.offset = 3
91
+ end
92
+
93
+ class BIF < Currency #:nodoc:
94
+ self.name = %q{Burundian franc}
95
+ self.code = %q{BIF}
96
+ self.offset = 0
97
+ end
98
+
99
+ class BMD < Currency #:nodoc:
100
+ self.name = %q{Bermudian dollar}
101
+ self.code = %q{BMD}
102
+ self.offset = 2
103
+ end
104
+
105
+ class BND < Currency #:nodoc:
106
+ self.name = %q{Brunei dollar}
107
+ self.code = %q{BND}
108
+ self.offset = 2
109
+ end
110
+
111
+ class BOB < Currency #:nodoc:
112
+ self.name = %q{Boliviano}
113
+ self.code = %q{BOB}
114
+ self.offset = 2
115
+ end
116
+
117
+ class BRL < Currency #:nodoc:
118
+ self.name = %q{Brazilian real}
119
+ self.code = %q{BRL}
120
+ self.offset = 2
121
+ end
122
+
123
+ class BSD < Currency #:nodoc:
124
+ self.name = %q{Bahamian dollar}
125
+ self.code = %q{BSD}
126
+ self.offset = 2
127
+ end
128
+
129
+ class BTN < Currency #:nodoc:
130
+ self.name = %q{Ngultrum}
131
+ self.code = %q{BTN}
132
+ self.offset = 2
133
+ end
134
+
135
+ class BWP < Currency #:nodoc:
136
+ self.name = %q{Pula}
137
+ self.code = %q{BWP}
138
+ self.offset = 2
139
+ end
140
+
141
+ class BYR < Currency #:nodoc:
142
+ self.name = %q{Belarussian ruble}
143
+ self.code = %q{BYR}
144
+ self.offset = 0
145
+ end
146
+
147
+ class BZD < Currency #:nodoc:
148
+ self.name = %q{Belize dollar}
149
+ self.code = %q{BZD}
150
+ self.offset = 2
151
+ end
152
+
153
+ class CAD < Currency #:nodoc:
154
+ self.name = %q{Canadian dollar}
155
+ self.code = %q{CAD}
156
+ self.offset = 2
157
+ end
158
+
159
+ class CDF < Currency #:nodoc:
160
+ self.name = %q{Franc Congolais}
161
+ self.code = %q{CDF}
162
+ self.offset = 2
163
+ end
164
+
165
+ class CHE < Currency #:nodoc:
166
+ self.name = %q{WIR eurocomplementary currency}
167
+ self.code = %q{CHE}
168
+ self.offset = 2
169
+ end
170
+
171
+ class CHF < Currency #:nodoc:
172
+ self.name = %q{Swiss franc}
173
+ self.code = %q{CHF}
174
+ self.offset = 2
175
+ end
176
+
177
+ class CHW < Currency #:nodoc:
178
+ self.name = %q{WIR franccomplementary currency}
179
+ self.code = %q{CHW}
180
+ self.offset = 2
181
+ end
182
+
183
+ class CLF < Currency #:nodoc:
184
+ self.name = %q{Unidad de Fomento}
185
+ self.code = %q{CLF}
186
+ self.offset = 0
187
+ end
188
+
189
+ class CLP < Currency #:nodoc:
190
+ self.name = %q{Chilean peso}
191
+ self.code = %q{CLP}
192
+ self.offset = 0
193
+ end
194
+
195
+ class CNY < Currency #:nodoc:
196
+ self.name = %q{Renminbi}
197
+ self.code = %q{CNY}
198
+ self.offset = 2
199
+ end
200
+
201
+ class COP < Currency #:nodoc:
202
+ self.name = %q{Colombian peso}
203
+ self.code = %q{COP}
204
+ self.offset = 2
205
+ end
206
+
207
+ class COU < Currency #:nodoc:
208
+ self.name = %q{Unidad de Valor Real}
209
+ self.code = %q{COU}
210
+ self.offset = 2
211
+ end
212
+
213
+ class CRC < Currency #:nodoc:
214
+ self.name = %q{Costa Rican colon}
215
+ self.code = %q{CRC}
216
+ self.offset = 2
217
+ end
218
+
219
+ class CUP < Currency #:nodoc:
220
+ self.name = %q{Cuban peso}
221
+ self.code = %q{CUP}
222
+ self.offset = 2
223
+ end
224
+
225
+ class CVE < Currency #:nodoc:
226
+ self.name = %q{Cape Verde escudo}
227
+ self.code = %q{CVE}
228
+ self.offset = 2
229
+ end
230
+
231
+ class CZK < Currency #:nodoc:
232
+ self.name = %q{Czech koruna}
233
+ self.code = %q{CZK}
234
+ self.offset = 2
235
+ end
236
+
237
+ class DJF < Currency #:nodoc:
238
+ self.name = %q{Djibouti franc}
239
+ self.code = %q{DJF}
240
+ self.offset = 0
241
+ end
242
+
243
+ class DKK < Currency #:nodoc:
244
+ self.name = %q{Danish krone}
245
+ self.code = %q{DKK}
246
+ self.offset = 2
247
+ end
248
+
249
+ class DOP < Currency #:nodoc:
250
+ self.name = %q{Dominican peso}
251
+ self.code = %q{DOP}
252
+ self.offset = 2
253
+ end
254
+
255
+ class DZD < Currency #:nodoc:
256
+ self.name = %q{Algerian dinar}
257
+ self.code = %q{DZD}
258
+ self.offset = 2
259
+ end
260
+
261
+ class EEK < Currency #:nodoc:
262
+ self.name = %q{Kroon}
263
+ self.code = %q{EEK}
264
+ self.offset = 2
265
+ end
266
+
267
+ class EGP < Currency #:nodoc:
268
+ self.name = %q{Egyptian pound}
269
+ self.code = %q{EGP}
270
+ self.offset = 2
271
+ end
272
+
273
+ class ERN < Currency #:nodoc:
274
+ self.name = %q{Nakfa}
275
+ self.code = %q{ERN}
276
+ self.offset = 2
277
+ end
278
+
279
+ class ETB < Currency #:nodoc:
280
+ self.name = %q{Ethiopian birr}
281
+ self.code = %q{ETB}
282
+ self.offset = 2
283
+ end
284
+
285
+ class EUR < Currency #:nodoc:
286
+ self.name = %q{Euro}
287
+ self.code = %q{EUR}
288
+ self.offset = 2
289
+ end
290
+
291
+ class FJD < Currency #:nodoc:
292
+ self.name = %q{Fiji dollar}
293
+ self.code = %q{FJD}
294
+ self.offset = 2
295
+ end
296
+
297
+ class FKP < Currency #:nodoc:
298
+ self.name = %q{Falkland Islands pound}
299
+ self.code = %q{FKP}
300
+ self.offset = 2
301
+ end
302
+
303
+ class GBP < Currency #:nodoc:
304
+ self.name = %q{Pound sterling}
305
+ self.code = %q{GBP}
306
+ self.offset = 2
307
+ end
308
+
309
+ class GEL < Currency #:nodoc:
310
+ self.name = %q{Lari}
311
+ self.code = %q{GEL}
312
+ self.offset = 2
313
+ end
314
+
315
+ class GHS < Currency #:nodoc:
316
+ self.name = %q{Cedi}
317
+ self.code = %q{GHS}
318
+ self.offset = 2
319
+ end
320
+
321
+ class GIP < Currency #:nodoc:
322
+ self.name = %q{Gibraltar pound}
323
+ self.code = %q{GIP}
324
+ self.offset = 2
325
+ end
326
+
327
+ class GMD < Currency #:nodoc:
328
+ self.name = %q{Dalasi}
329
+ self.code = %q{GMD}
330
+ self.offset = 2
331
+ end
332
+
333
+ class GNF < Currency #:nodoc:
334
+ self.name = %q{Guinea franc}
335
+ self.code = %q{GNF}
336
+ self.offset = 0
337
+ end
338
+
339
+ class GTQ < Currency #:nodoc:
340
+ self.name = %q{Quetzal}
341
+ self.code = %q{GTQ}
342
+ self.offset = 2
343
+ end
344
+
345
+ class GYD < Currency #:nodoc:
346
+ self.name = %q{Guyana dollar}
347
+ self.code = %q{GYD}
348
+ self.offset = 2
349
+ end
350
+
351
+ class HKD < Currency #:nodoc:
352
+ self.name = %q{Hong Kong dollar}
353
+ self.code = %q{HKD}
354
+ self.offset = 2
355
+ end
356
+
357
+ class HNL < Currency #:nodoc:
358
+ self.name = %q{Lempira}
359
+ self.code = %q{HNL}
360
+ self.offset = 2
361
+ end
362
+
363
+ class HRK < Currency #:nodoc:
364
+ self.name = %q{Croatian kuna}
365
+ self.code = %q{HRK}
366
+ self.offset = 2
367
+ end
368
+
369
+ class HTG < Currency #:nodoc:
370
+ self.name = %q{Haiti gourde}
371
+ self.code = %q{HTG}
372
+ self.offset = 2
373
+ end
374
+
375
+ class HUF < Currency #:nodoc:
376
+ self.name = %q{Forint}
377
+ self.code = %q{HUF}
378
+ self.offset = 2
379
+ end
380
+
381
+ class IDR < Currency #:nodoc:
382
+ self.name = %q{Rupiah}
383
+ self.code = %q{IDR}
384
+ self.offset = 2
385
+ end
386
+
387
+ class ILS < Currency #:nodoc:
388
+ self.name = %q{Israeli new sheqel}
389
+ self.code = %q{ILS}
390
+ self.offset = 2
391
+ end
392
+
393
+ class INR < Currency #:nodoc:
394
+ self.name = %q{Indian rupee}
395
+ self.code = %q{INR}
396
+ self.offset = 2
397
+ end
398
+
399
+ class IQD < Currency #:nodoc:
400
+ self.name = %q{Iraqi dinar}
401
+ self.code = %q{IQD}
402
+ self.offset = 3
403
+ end
404
+
405
+ class IRR < Currency #:nodoc:
406
+ self.name = %q{Iranian rial}
407
+ self.code = %q{IRR}
408
+ self.offset = 2
409
+ end
410
+
411
+ class ISK < Currency #:nodoc:
412
+ self.name = %q{Iceland krona}
413
+ self.code = %q{ISK}
414
+ self.offset = 0
415
+ end
416
+
417
+ class JMD < Currency #:nodoc:
418
+ self.name = %q{Jamaican dollar}
419
+ self.code = %q{JMD}
420
+ self.offset = 2
421
+ end
422
+
423
+ class JOD < Currency #:nodoc:
424
+ self.name = %q{Jordanian dinar}
425
+ self.code = %q{JOD}
426
+ self.offset = 3
427
+ end
428
+
429
+ class JPY < Currency #:nodoc:
430
+ self.name = %q{Japanese yen}
431
+ self.code = %q{JPY}
432
+ self.offset = 0
433
+ end
434
+
435
+ class KES < Currency #:nodoc:
436
+ self.name = %q{Kenyan shilling}
437
+ self.code = %q{KES}
438
+ self.offset = 2
439
+ end
440
+
441
+ class KGS < Currency #:nodoc:
442
+ self.name = %q{Som}
443
+ self.code = %q{KGS}
444
+ self.offset = 2
445
+ end
446
+
447
+ class KHR < Currency #:nodoc:
448
+ self.name = %q{Riel}
449
+ self.code = %q{KHR}
450
+ self.offset = 2
451
+ end
452
+
453
+ class KMF < Currency #:nodoc:
454
+ self.name = %q{Comoro franc}
455
+ self.code = %q{KMF}
456
+ self.offset = 0
457
+ end
458
+
459
+ class KPW < Currency #:nodoc:
460
+ self.name = %q{North Korean won}
461
+ self.code = %q{KPW}
462
+ self.offset = 2
463
+ end
464
+
465
+ class KRW < Currency #:nodoc:
466
+ self.name = %q{South Korean won}
467
+ self.code = %q{KRW}
468
+ self.offset = 0
469
+ end
470
+
471
+ class KWD < Currency #:nodoc:
472
+ self.name = %q{Kuwaiti dinar}
473
+ self.code = %q{KWD}
474
+ self.offset = 3
475
+ end
476
+
477
+ class KYD < Currency #:nodoc:
478
+ self.name = %q{Cayman Islands dollar}
479
+ self.code = %q{KYD}
480
+ self.offset = 2
481
+ end
482
+
483
+ class KZT < Currency #:nodoc:
484
+ self.name = %q{Tenge}
485
+ self.code = %q{KZT}
486
+ self.offset = 2
487
+ end
488
+
489
+ class LAK < Currency #:nodoc:
490
+ self.name = %q{Kip}
491
+ self.code = %q{LAK}
492
+ self.offset = 2
493
+ end
494
+
495
+ class LBP < Currency #:nodoc:
496
+ self.name = %q{Lebanese pound}
497
+ self.code = %q{LBP}
498
+ self.offset = 2
499
+ end
500
+
501
+ class LKR < Currency #:nodoc:
502
+ self.name = %q{Sri Lanka rupee}
503
+ self.code = %q{LKR}
504
+ self.offset = 2
505
+ end
506
+
507
+ class LRD < Currency #:nodoc:
508
+ self.name = %q{Liberian dollar}
509
+ self.code = %q{LRD}
510
+ self.offset = 2
511
+ end
512
+
513
+ class LSL < Currency #:nodoc:
514
+ self.name = %q{Loti}
515
+ self.code = %q{LSL}
516
+ self.offset = 2
517
+ end
518
+
519
+ class LTL < Currency #:nodoc:
520
+ self.name = %q{Lithuanian litas}
521
+ self.code = %q{LTL}
522
+ self.offset = 2
523
+ end
524
+
525
+ class LVL < Currency #:nodoc:
526
+ self.name = %q{Latvian lats}
527
+ self.code = %q{LVL}
528
+ self.offset = 2
529
+ end
530
+
531
+ class LYD < Currency #:nodoc:
532
+ self.name = %q{Libyan dinar}
533
+ self.code = %q{LYD}
534
+ self.offset = 3
535
+ end
536
+
537
+ class MAD < Currency #:nodoc:
538
+ self.name = %q{Moroccan dirham}
539
+ self.code = %q{MAD}
540
+ self.offset = 2
541
+ end
542
+
543
+ class MDL < Currency #:nodoc:
544
+ self.name = %q{Moldovan leu}
545
+ self.code = %q{MDL}
546
+ self.offset = 2
547
+ end
548
+
549
+ class MGA < Currency #:nodoc:
550
+ self.name = %q{Malagasy ariary}
551
+ self.code = %q{MGA}
552
+ self.offset = 0
553
+ end
554
+
555
+ class MKD < Currency #:nodoc:
556
+ self.name = %q{Denar}
557
+ self.code = %q{MKD}
558
+ self.offset = 2
559
+ end
560
+
561
+ class MMK < Currency #:nodoc:
562
+ self.name = %q{Kyat}
563
+ self.code = %q{MMK}
564
+ self.offset = 2
565
+ end
566
+
567
+ class MNT < Currency #:nodoc:
568
+ self.name = %q{Tugrik}
569
+ self.code = %q{MNT}
570
+ self.offset = 2
571
+ end
572
+
573
+ class MOP < Currency #:nodoc:
574
+ self.name = %q{Pataca}
575
+ self.code = %q{MOP}
576
+ self.offset = 2
577
+ end
578
+
579
+ class MRO < Currency #:nodoc:
580
+ self.name = %q{Ouguiya}
581
+ self.code = %q{MRO}
582
+ self.offset = 0
583
+ end
584
+
585
+ class MUR < Currency #:nodoc:
586
+ self.name = %q{Mauritius rupee}
587
+ self.code = %q{MUR}
588
+ self.offset = 2
589
+ end
590
+
591
+ class MVR < Currency #:nodoc:
592
+ self.name = %q{Rufiyaa}
593
+ self.code = %q{MVR}
594
+ self.offset = 2
595
+ end
596
+
597
+ class MWK < Currency #:nodoc:
598
+ self.name = %q{Kwacha}
599
+ self.code = %q{MWK}
600
+ self.offset = 2
601
+ end
602
+
603
+ class MXN < Currency #:nodoc:
604
+ self.name = %q{Mexican peso}
605
+ self.code = %q{MXN}
606
+ self.offset = 2
607
+ end
608
+
609
+ class MXV < Currency #:nodoc:
610
+ self.name = %q{Mexican Unidad de Inversion}
611
+ self.code = %q{MXV}
612
+ self.offset = 2
613
+ end
614
+
615
+ class MYR < Currency #:nodoc:
616
+ self.name = %q{Malaysian ringgit}
617
+ self.code = %q{MYR}
618
+ self.offset = 2
619
+ end
620
+
621
+ class MZN < Currency #:nodoc:
622
+ self.name = %q{Metical}
623
+ self.code = %q{MZN}
624
+ self.offset = 2
625
+ end
626
+
627
+ class NAD < Currency #:nodoc:
628
+ self.name = %q{Namibian dollar}
629
+ self.code = %q{NAD}
630
+ self.offset = 2
631
+ end
632
+
633
+ class NGN < Currency #:nodoc:
634
+ self.name = %q{Naira}
635
+ self.code = %q{NGN}
636
+ self.offset = 2
637
+ end
638
+
639
+ class NIO < Currency #:nodoc:
640
+ self.name = %q{Cordoba oro}
641
+ self.code = %q{NIO}
642
+ self.offset = 2
643
+ end
644
+
645
+ class NOK < Currency #:nodoc:
646
+ self.name = %q{Norwegian krone}
647
+ self.code = %q{NOK}
648
+ self.offset = 2
649
+ end
650
+
651
+ class NPR < Currency #:nodoc:
652
+ self.name = %q{Nepalese rupee}
653
+ self.code = %q{NPR}
654
+ self.offset = 2
655
+ end
656
+
657
+ class NZD < Currency #:nodoc:
658
+ self.name = %q{New Zealand dollar}
659
+ self.code = %q{NZD}
660
+ self.offset = 2
661
+ end
662
+
663
+ class OMR < Currency #:nodoc:
664
+ self.name = %q{Rial Omani}
665
+ self.code = %q{OMR}
666
+ self.offset = 3
667
+ end
668
+
669
+ class PAB < Currency #:nodoc:
670
+ self.name = %q{Balboa}
671
+ self.code = %q{PAB}
672
+ self.offset = 2
673
+ end
674
+
675
+ class PEN < Currency #:nodoc:
676
+ self.name = %q{Nuevo sol}
677
+ self.code = %q{PEN}
678
+ self.offset = 2
679
+ end
680
+
681
+ class PGK < Currency #:nodoc:
682
+ self.name = %q{Kina}
683
+ self.code = %q{PGK}
684
+ self.offset = 2
685
+ end
686
+
687
+ class PHP < Currency #:nodoc:
688
+ self.name = %q{Philippine peso}
689
+ self.code = %q{PHP}
690
+ self.offset = 2
691
+ end
692
+
693
+ class PKR < Currency #:nodoc:
694
+ self.name = %q{Pakistan rupee}
695
+ self.code = %q{PKR}
696
+ self.offset = 2
697
+ end
698
+
699
+ class PLN < Currency #:nodoc:
700
+ self.name = %q{Zloty}
701
+ self.code = %q{PLN}
702
+ self.offset = 2
703
+ end
704
+
705
+ class PYG < Currency #:nodoc:
706
+ self.name = %q{Guarani}
707
+ self.code = %q{PYG}
708
+ self.offset = 0
709
+ end
710
+
711
+ class QAR < Currency #:nodoc:
712
+ self.name = %q{Qatari rial}
713
+ self.code = %q{QAR}
714
+ self.offset = 2
715
+ end
716
+
717
+ class RON < Currency #:nodoc:
718
+ self.name = %q{Romanian new leu}
719
+ self.code = %q{RON}
720
+ self.offset = 2
721
+ end
722
+
723
+ class RSD < Currency #:nodoc:
724
+ self.name = %q{Serbian dinar}
725
+ self.code = %q{RSD}
726
+ self.offset = 2
727
+ end
728
+
729
+ class RUB < Currency #:nodoc:
730
+ self.name = %q{Russian rouble}
731
+ self.code = %q{RUB}
732
+ self.offset = 2
733
+ end
734
+
735
+ class RWF < Currency #:nodoc:
736
+ self.name = %q{Rwanda franc}
737
+ self.code = %q{RWF}
738
+ self.offset = 0
739
+ end
740
+
741
+ class SAR < Currency #:nodoc:
742
+ self.name = %q{Saudi riyal}
743
+ self.code = %q{SAR}
744
+ self.offset = 2
745
+ end
746
+
747
+ class SBD < Currency #:nodoc:
748
+ self.name = %q{Solomon Islands dollar}
749
+ self.code = %q{SBD}
750
+ self.offset = 2
751
+ end
752
+
753
+ class SCR < Currency #:nodoc:
754
+ self.name = %q{Seychelles rupee}
755
+ self.code = %q{SCR}
756
+ self.offset = 2
757
+ end
758
+
759
+ class SDG < Currency #:nodoc:
760
+ self.name = %q{Sudanese pound}
761
+ self.code = %q{SDG}
762
+ self.offset = 2
763
+ end
764
+
765
+ class SEK < Currency #:nodoc:
766
+ self.name = %q{Swedish krona}
767
+ self.code = %q{SEK}
768
+ self.offset = 2
769
+ end
770
+
771
+ class SGD < Currency #:nodoc:
772
+ self.name = %q{Singapore dollar}
773
+ self.code = %q{SGD}
774
+ self.offset = 2
775
+ end
776
+
777
+ class SHP < Currency #:nodoc:
778
+ self.name = %q{Saint Helena pound}
779
+ self.code = %q{SHP}
780
+ self.offset = 2
781
+ end
782
+
783
+ class SKK < Currency #:nodoc:
784
+ self.name = %q{Slovak koruna}
785
+ self.code = %q{SKK}
786
+ self.offset = 2
787
+ end
788
+
789
+ class SLL < Currency #:nodoc:
790
+ self.name = %q{Leone}
791
+ self.code = %q{SLL}
792
+ self.offset = 2
793
+ end
794
+
795
+ class SOS < Currency #:nodoc:
796
+ self.name = %q{Somali shilling}
797
+ self.code = %q{SOS}
798
+ self.offset = 2
799
+ end
800
+
801
+ class SRD < Currency #:nodoc:
802
+ self.name = %q{Surinam dollar}
803
+ self.code = %q{SRD}
804
+ self.offset = 2
805
+ end
806
+
807
+ class STD < Currency #:nodoc:
808
+ self.name = %q{Dobra}
809
+ self.code = %q{STD}
810
+ self.offset = 2
811
+ end
812
+
813
+ class SYP < Currency #:nodoc:
814
+ self.name = %q{Syrian pound}
815
+ self.code = %q{SYP}
816
+ self.offset = 2
817
+ end
818
+
819
+ class SZL < Currency #:nodoc:
820
+ self.name = %q{Lilangeni}
821
+ self.code = %q{SZL}
822
+ self.offset = 2
823
+ end
824
+
825
+ class THB < Currency #:nodoc:
826
+ self.name = %q{Baht}
827
+ self.code = %q{THB}
828
+ self.offset = 2
829
+ end
830
+
831
+ class TJS < Currency #:nodoc:
832
+ self.name = %q{Somoni}
833
+ self.code = %q{TJS}
834
+ self.offset = 2
835
+ end
836
+
837
+ class TMM < Currency #:nodoc:
838
+ self.name = %q{Manat}
839
+ self.code = %q{TMM}
840
+ self.offset = 2
841
+ end
842
+
843
+ class TND < Currency #:nodoc:
844
+ self.name = %q{Tunisian dinar}
845
+ self.code = %q{TND}
846
+ self.offset = 3
847
+ end
848
+
849
+ class TOP < Currency #:nodoc:
850
+ self.name = %q{Pa'anga}
851
+ self.code = %q{TOP}
852
+ self.offset = 2
853
+ end
854
+
855
+ class TRY < Currency #:nodoc:
856
+ self.name = %q{New Turkish lira}
857
+ self.code = %q{TRY}
858
+ self.offset = 2
859
+ end
860
+
861
+ class TTD < Currency #:nodoc:
862
+ self.name = %q{Trinidad and Tobago dollar}
863
+ self.code = %q{TTD}
864
+ self.offset = 2
865
+ end
866
+
867
+ class TWD < Currency #:nodoc:
868
+ self.name = %q{New Taiwan dollar}
869
+ self.code = %q{TWD}
870
+ self.offset = 2
871
+ end
872
+
873
+ class TZS < Currency #:nodoc:
874
+ self.name = %q{Tanzanian shilling}
875
+ self.code = %q{TZS}
876
+ self.offset = 2
877
+ end
878
+
879
+ class UAH < Currency #:nodoc:
880
+ self.name = %q{Hryvnia}
881
+ self.code = %q{UAH}
882
+ self.offset = 2
883
+ end
884
+
885
+ class UGX < Currency #:nodoc:
886
+ self.name = %q{Uganda shilling}
887
+ self.code = %q{UGX}
888
+ self.offset = 2
889
+ end
890
+
891
+ class USD < Currency #:nodoc:
892
+ self.name = %q{US dollar}
893
+ self.code = %q{USD}
894
+ self.offset = 2
895
+ end
896
+
897
+ class UYU < Currency #:nodoc:
898
+ self.name = %q{Peso Uruguayo}
899
+ self.code = %q{UYU}
900
+ self.offset = 2
901
+ end
902
+
903
+ class UZS < Currency #:nodoc:
904
+ self.name = %q{Uzbekistan som}
905
+ self.code = %q{UZS}
906
+ self.offset = 2
907
+ end
908
+
909
+ class VEF < Currency #:nodoc:
910
+ self.name = %q{Venezuelan bolívar fuerte}
911
+ self.code = %q{VEF}
912
+ self.offset = 2
913
+ end
914
+
915
+ class VND < Currency #:nodoc:
916
+ self.name = %q{Vietnamese đồng}
917
+ self.code = %q{VND}
918
+ self.offset = 2
919
+ end
920
+
921
+ class VUV < Currency #:nodoc:
922
+ self.name = %q{Vatu}
923
+ self.code = %q{VUV}
924
+ self.offset = 0
925
+ end
926
+
927
+ class WST < Currency #:nodoc:
928
+ self.name = %q{Samoan tala}
929
+ self.code = %q{WST}
930
+ self.offset = 2
931
+ end
932
+
933
+ class XAF < Currency #:nodoc:
934
+ self.name = %q{CFA franc BEAC}
935
+ self.code = %q{XAF}
936
+ self.offset = 0
937
+ end
938
+
939
+ class XAG < Currency #:nodoc:
940
+ self.name = %q{Silvertroy ounce}
941
+ self.code = %q{XAG}
942
+ self.offset = 0
943
+ end
944
+
945
+ class XAU < Currency #:nodoc:
946
+ self.name = %q{Goldtroy ounce}
947
+ self.code = %q{XAU}
948
+ self.offset = 0
949
+ end
950
+
951
+ class XBA < Currency #:nodoc:
952
+ self.name = %q{European Composite Unit}
953
+ self.code = %q{XBA}
954
+ self.offset = 0
955
+ end
956
+
957
+ class XBB < Currency #:nodoc:
958
+ self.name = %q{European Monetary Unit}
959
+ self.code = %q{XBB}
960
+ self.offset = 0
961
+ end
962
+
963
+ class XBC < Currency #:nodoc:
964
+ self.name = %q{European Unit of Account 9}
965
+ self.code = %q{XBC}
966
+ self.offset = 0
967
+ end
968
+
969
+ class XBD < Currency #:nodoc:
970
+ self.name = %q{European Unit of Account 17}
971
+ self.code = %q{XBD}
972
+ self.offset = 0
973
+ end
974
+
975
+ class XCD < Currency #:nodoc:
976
+ self.name = %q{East Caribbean dollar}
977
+ self.code = %q{XCD}
978
+ self.offset = 2
979
+ end
980
+
981
+ class XDR < Currency #:nodoc:
982
+ self.name = %q{Special Drawing Rights}
983
+ self.code = %q{XDR}
984
+ self.offset = 0
985
+ end
986
+
987
+ class XFU < Currency #:nodoc:
988
+ self.name = %q{UIC franc}
989
+ self.code = %q{XFU}
990
+ self.offset = 0
991
+ end
992
+
993
+ class XOF < Currency #:nodoc:
994
+ self.name = %q{CFA Franc BCEAO}
995
+ self.code = %q{XOF}
996
+ self.offset = 0
997
+ end
998
+
999
+ class XPD < Currency #:nodoc:
1000
+ self.name = %q{Palladiumtroy ounce}
1001
+ self.code = %q{XPD}
1002
+ self.offset = 0
1003
+ end
1004
+
1005
+ class XPF < Currency #:nodoc:
1006
+ self.name = %q{CFP franc}
1007
+ self.code = %q{XPF}
1008
+ self.offset = 0
1009
+ end
1010
+
1011
+ class XPT < Currency #:nodoc:
1012
+ self.name = %q{Platinumtroy ounce}
1013
+ self.code = %q{XPT}
1014
+ self.offset = 0
1015
+ end
1016
+
1017
+ class YER < Currency #:nodoc:
1018
+ self.name = %q{Yemeni rial}
1019
+ self.code = %q{YER}
1020
+ self.offset = 2
1021
+ end
1022
+
1023
+ class ZAR < Currency #:nodoc:
1024
+ self.name = %q{South African rand}
1025
+ self.code = %q{ZAR}
1026
+ self.offset = 2
1027
+ end
1028
+
1029
+ class ZMK < Currency #:nodoc:
1030
+ self.name = %q{Kwacha}
1031
+ self.code = %q{ZMK}
1032
+ self.offset = 2
1033
+ end
1034
+
1035
+ class ZWD < Currency #:nodoc:
1036
+ self.name = %q{Zimbabwe dollar}
1037
+ self.code = %q{ZWD}
1038
+ self.offset = 2
1039
+ end
1040
+
1041
+ end # Currency
1042
+ end # BigMoney
1043
+