Class: Covid19::Client
- Inherits:
-
Thor
- Object
- Thor
- Covid19::Client
- Defined in:
- lib/covid19/client.rb
Class Method Summary collapse
Instance Method Summary collapse
- #all_continents ⇒ Object
- #all_countries ⇒ Object
- #continent(continent_name) ⇒ Object
- #country(country_name) ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
7 8 9 |
# File 'lib/covid19/client.rb', line 7 def self.exit_on_failure? true end |
Instance Method Details
#all_continents ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/covid19/client.rb', line 13 def all_continents locality = Covid19::Decorators::Table::LOCALITY[:continent] result = Covid19::Services::Covid19Data.all_continents puts [:table] ? Covid19::Decorators::Table.create(data: result, locality: locality) : result end |
#all_countries ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/covid19/client.rb', line 24 def all_countries locality = Covid19::Decorators::Table::LOCALITY[:country] result = Covid19::Services::Covid19Data.all_countries puts [:table] ? Covid19::Decorators::Table.create(data: result, locality: locality): result end |
#continent(continent_name) ⇒ Object
35 36 37 38 39 |
# File 'lib/covid19/client.rb', line 35 def continent(continent_name) result = Covid19::Services::Covid19Data.continent(continent_name) puts [:table] ? Covid19::Decorators::Table.create(data: result) : result end |
#country(country_name) ⇒ Object
43 44 45 46 47 |
# File 'lib/covid19/client.rb', line 43 def country(country_name) result = Covid19::Services::Covid19Data.country(country_name) puts [:table] ? Covid19::Decorators::Table.create(data: result) : result end |