Class: Repositories::Statistics
- Inherits:
-
BaseRepository
- Object
- BaseRepository
- Repositories::Statistics
- 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
Instance Method Summary collapse
Methods inherited from BaseRepository
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 |
#global ⇒ Object
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 |