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.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'currency_conversion'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3.1'
4
4
  s.summary = "Currency Conversion"
5
5
  s.description = "Currency conversion gem"
6
6
  s.add_runtime_dependency 'rest-client', ['~> 1.6.7']
@@ -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: "usd", to: args
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.2
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-04-29 00:00:00.000000000 Z
13
+ date: 2013-05-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client