lib/convertator/providers/cbr_provider.rb in convertator-0.1.1 vs lib/convertator/providers/cbr_provider.rb in convertator-0.2.0
- old
+ new
@@ -2,21 +2,21 @@
require 'rexml/document'
module Convertator
module Providers
class CbrProvider
- SERVICE_URI = 'http://www.cbr.ru/scripts/xml_daily.asp'
+ SERVICE_URI = 'http://www.cbr.ru/scripts/xml_daily.asp'.freeze
- def new_rates
+ def new_rates
default_rates.merge parse(fetch)
end
private
def default_rates
{
- RUB: "1",
+ RUB: '1'
}
end
def parse(data)
doc = REXML::Document.new(data)
@@ -29,10 +29,10 @@
rates
end
def fetch
uri = URI(SERVICE_URI)
- ::Net::HTTP.get(uri)
+ ::Net::HTTP.get(uri)
end
end
end
end