Class: Covid19
- Inherits:
-
Object
- Object
- Covid19
- 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
- .latest_stats ⇒ Object
- .latest_stats_by_country_code(country_code, with_timelines = false) ⇒ Object
- .latest_stats_by_country_id(id) ⇒ Object
- .latest_stats_split_by_country ⇒ Object
Class Method Details
.latest_stats ⇒ Object
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_country ⇒ Object
17 18 19 |
# File 'lib/covid19.rb', line 17 def latest_stats_split_by_country return retrieve_api_data('locations') end |