class PublicIp::Service::IpChicken
Public Class Methods
parse_ip_address(response_body)
click to toggle source
# File lib/public_ip/service/ip_chicken.rb, line 10 def self.parse_ip_address(response_body) parsed_html = Nokogiri::HTML(response_body).css('table:nth-of-type(2) p:nth-of-type(2) b') parsed_html.text.match(/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}/)[0] end
uri()
click to toggle source
# File lib/public_ip/service/ip_chicken.rb, line 6 def self.uri URI('http://www.ipchicken.com/') end