Sha256: 83e1450d43b0bf4b7db699f2bf3baf7ff7dba5c60b67c3ac840993eed5bf793e

Contents?: true

Size: 436 Bytes

Versions: 1

Compression:

Stored size: 436 Bytes

Contents

class Wettr::IPAPI
  include HTTParty

  base_uri "https://ipapi.co"
  # https://ipapi.co/1.1.1.1/json

  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

  private

  def self.call
    response = self.class.get("#{ip}/json")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wettr-0.1.3 lib/wettr/ip_api.rb