Class: Covid19

Inherits:
Object
  • Object
show all
Defined in:
lib/covid19.rb,
lib/covid19/version.rb

Overview

To Follow

Constant Summary collapse

API_URL =
'https://coronavirus-tracker-api.herokuapp.com/v2/'.freeze
VERSION =
'0.1.3'.freeze

Class Method Summary collapse

Class Method Details

.latest_statsObject



13
14
15
# File 'lib/covid19.rb', line 13

def latest_stats
    return retrieve_api_data('latest')
end

.latest_stats_by_country_code(country_code, with_timelines = false) ⇒ Object



21
22
23
24
# File 'lib/covid19.rb', line 21

def latest_stats_by_country_code(country_code, with_timelines = false)
    timelines = with_timelines ? '&timelines=true' : ''
    return retrieve_api_data("locations?country_code=#{country_code.upcase}#{timelines}")
end

.latest_stats_by_country_id(id) ⇒ Object



26
27
28
# File 'lib/covid19.rb', line 26

def latest_stats_by_country_id(id)
    return retrieve_api_data("locations/#{id}")
end

.latest_stats_split_by_countryObject



17
18
19
# File 'lib/covid19.rb', line 17

def latest_stats_split_by_country
    return retrieve_api_data('locations')
end