currency_conversion 0.0.2 → 0.0.3.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.
- data/currency_conversion.gemspec +1 -1
- data/lib/currency_conversion/model.rb +3 -3
- metadata +2 -2
data/currency_conversion.gemspec
CHANGED
@@ -3,9 +3,9 @@ module CurrencyConversion
|
|
3
3
|
module Model
|
4
4
|
def conversion_fields(*fields)
|
5
5
|
fields.each do |field|
|
6
|
-
define_method "#{field.to_s}_to" do |args|
|
7
|
-
return self.send(field) if args.nil? || args == "usd"
|
8
|
-
@gateway = CurrencyConversion::Gateway.new value: self.send(field), from:
|
6
|
+
define_method "#{field.to_s}_to" do |args, from="usd"|
|
7
|
+
return self.send(field) if args.nil? || ( args == "usd" && from == "usd" )
|
8
|
+
@gateway = CurrencyConversion::Gateway.new value: self.send(field), from: from , to: args
|
9
9
|
@gateway.convert_payment
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: currency_conversion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|