Class: Covidstats::API

Inherits:
Object
  • Object
show all
Defined in:
lib/covidstats/api.rb

Class Method Summary collapse

Class Method Details

.get_reportsObject



2
3
4
5
6
# File 'lib/covidstats/api.rb', line 2

def self.get_reports
 site = HTTParty.get("https://covid19api.io/api/v1/AllReports")
 reports = site["reports"]
 reports = reports[0]["table"][0] #array of hashes that are all the reports/stats per country
end