Class: Repositories::Timeline

Inherits:
BaseRepository show all
Defined in:
lib/covid19/lib/repositories/virus_tracker/timeline_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
# File 'lib/covid19/lib/repositories/virus_tracker/timeline_repository.rb', line 9

def by_country(country:)
  retrieve(resource: DEFAULT_RESOURCE, query: { countryTimeline: country&.upcase })
end

#globalObject



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

def global
  retrieve(resource: 'timeline/map-data.json', query: {})
end