Class: GeoPPPFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/geo_ppp/fetcher.rb

Constant Summary collapse

GEO_API_URL =
'https://freegeoip.app/json/'.freeze
PPP_API_URL =

api.purchasing-power-parity.com/?target=ID redirects to ppp-api.fly.dev/?target=ID and then results are returned

'https://ppp-api.fly.dev/?target='.freeze

Class Method Summary collapse

Class Method Details

.fetch(country_code = nil) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/geo_ppp/fetcher.rb', line 9

def self.fetch(country_code = nil)
geo = if country_code.nil?
	fetch_geo
else
	{ 'country_code' => country_code }
end
	fetch_ppp(geo)
end