Skip to content

Commit

Permalink
[fix] fix #11
Browse files Browse the repository at this point in the history
  • Loading branch information
jin5354 committed Jun 8, 2018
1 parent a804715 commit 1e37612
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
output["items"].push(temp)
else
if target.nil?
if units.include?(cy)
units.delete(cy)
end
uri = URI("https://exchangeratesapi.io/api/latest?base=#{cy}&symbols=#{units.join(',')}")
result = JSON.parse(Net::HTTP.get(uri))
result['rates'].each do |key, value|
Expand Down Expand Up @@ -76,6 +79,9 @@
end
end
else
if units.include?(base)
units.delete(base)
end
uri = URI("https://exchangeratesapi.io/api/latest?base=#{base}&symbols=#{units.join(',')}")
result = JSON.parse(Net::HTTP.get(uri))
result['rates'].each do |key, value|
Expand Down

0 comments on commit 1e37612

Please sign in to comment.