lib/eia/ibge.rb in eia-1.0.1 vs lib/eia/ibge.rb in eia-1.1.1
- old
+ new
@@ -56,14 +56,14 @@
if classification != '' and classification != nil then
ws = classification.split('|')
url += "/c#{ws[0]}/#{ws[1]}"
end
- return consume_json(Net::HTTP.get(URI(url)))
+ return consume_json(Net::HTTP.get(URI(url)), code)
end
- def consume_json(json_string)
+ def consume_json(json_string, table_code)
begin
output = JSON.parse(json_string)
heading = output.delete_at(0)
identifier = heading["D1C"]
@@ -104,10 +104,10 @@
else
#This information is discarded
end
end
- data_array << DataIBGE.new(date, variable, location, product, unit, val, periodicity)
+ data_array << DataIBGE.new(table_code, date, variable, location, product, unit, val, periodicity)
end
return data_array
rescue Exception => e