Class: Repositories::Statistics

Inherits:
BaseRepository show all
Defined in:
lib/covid19/lib/repositories/virus_tracker/statistics_repository.rb

Constant Summary

Constants inherited from BaseRepository

BaseRepository::DEFAULT_RESOURCE, BaseRepository::GLOBAL_STATS_URL

Instance Attribute Summary

Attributes inherited from BaseRepository

#query_validator

Instance Method Summary collapse

Methods inherited from BaseRepository

#initialize

Constructor Details

This class inherits a constructor from BaseRepository

Instance Method Details

#by_country(country:) ⇒ Object



9
10
11
12
# File 'lib/covid19/lib/repositories/virus_tracker/statistics_repository.rb', line 9

def by_country(country:)
  country = country.upcase unless country.nil?
  retrieve(resource: DEFAULT_RESOURCE, query: { countryTotal: country })
end

#globalObject



5
6
7
# File 'lib/covid19/lib/repositories/virus_tracker/statistics_repository.rb', line 5

def global
  retrieve(resource: DEFAULT_RESOURCE, query: { global: 'stats' })
end