Class: Wettr::IPAPI

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/wettr/ip_api.rb

Class Method Summary collapse

Class Method Details

.call_without_ipObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/wettr/ip_api.rb', line 7

def self.call_without_ip
  response = self.get("/json")
  
  if response["error"]
    puts "Encountered the following error with IPAPI.co:"
    puts response["reason"]
    puts response["message"]

    exit
  end

  response
end