Class: Repositories::News
- Inherits:
-
Object
- Object
- Repositories::News
- Defined in:
- lib/covid19/lib/repositories/news/news_repository.rb
Constant Summary collapse
- WHO_FEED =
'https://www.who.int/rss-feeds/news-english.xml'
Instance Method Summary collapse
Instance Method Details
#retrieve(**args) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/covid19/lib/repositories/news/news_repository.rb', line 7 def retrieve(**args) arssene = Arssene::Feed.request(rss(args), from_date: DateTime.now - 2)[:channel] data = { title: arssene.title, description: arssene.description, entries: entries_to_hash(arssene.entries) } data.to_json end |