Class: PublicIp::Service::JsonType

Inherits:
Simple
  • Object
show all
Extended by:
Registrable
Defined in:
lib/public_ip/service/json_type.rb

Direct Known Subclasses

IpAPI, Ipify, WtfIsMyIp

Instance Attribute Summary

Attributes inherited from Simple

#headers, #uri

Class Method Summary collapse

Methods included from Registrable

inherited

Methods inherited from Simple

headers, ip, perform_request, symbol, uri

Class Method Details

.extract_ip(response) ⇒ Object



12
13
14
# File 'lib/public_ip/service/json_type.rb', line 12

def self.extract_ip(response)
  parse_json(JSON.parse(response.body.strip))
end

.parse_json(_json_data) ⇒ Object



8
9
10
# File 'lib/public_ip/service/json_type.rb', line 8

def self.parse_json(_json_data)
  raise 'Not implemented'
end