i18n-complements 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/i18n-complements/numisma/currency.rb +4 -0
- data/lib/i18n-complements/numisma.rb +8 -0
- data/test/test_currencies.rb +16 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -36,6 +36,10 @@ module I18nComplements
|
|
36
36
|
self.code == other_currency.code
|
37
37
|
end
|
38
38
|
|
39
|
+
def to_currency
|
40
|
+
self
|
41
|
+
end
|
42
|
+
|
39
43
|
# Produces a amount of the currency with the locale parameters
|
40
44
|
# TODO: Find a better way to specify number formats which are more complex that the default Rails use
|
41
45
|
def localize(amount, options={})
|
data/test/test_currencies.rb
CHANGED
@@ -95,7 +95,23 @@ class TestCurrencies < Test::Unit::TestCase
|
|
95
95
|
assert_nothing_raised do
|
96
96
|
"USD".to_currency.name
|
97
97
|
end
|
98
|
+
|
99
|
+
assert_nothing_raised do
|
100
|
+
:JPY.to_currency.to_currency.name
|
101
|
+
end
|
102
|
+
|
103
|
+
assert_nothing_raised do
|
104
|
+
:JPY.to_currency.to_currency.to_currency.name
|
105
|
+
end
|
106
|
+
|
107
|
+
assert_equal :JPY.to_currency, :JPY.to_currency.to_currency
|
108
|
+
|
109
|
+
currency = :JPY.to_currency
|
110
|
+
|
111
|
+
assert_equal currency, currency.to_currency
|
112
|
+
assert_equal currency.to_currency, currency.to_currency.to_currency
|
98
113
|
end
|
99
114
|
|
100
115
|
|
116
|
+
|
101
117
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: i18n-complements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
version: !binary |-
|
5
|
-
|
5
|
+
MC4wLjQ=
|
6
6
|
prerelease:
|
7
7
|
platform: ruby
|
8
8
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n
|