Sha256: 6717e0b3ad647853029102a7acae944591f4920d7ba1ae68c46c19cb81ec6d45

Contents?: true

Size: 336 Bytes

Versions: 9

Compression:

Stored size: 336 Bytes

Contents

require 'httparty'
require 'ipaddress'


module Moocher
  module Ip
    def ip_blacklisted?(ipaddress)
      return "IP Address doesn't seem to be valid." if !(IPAddress.valid? ipaddress)
      base_url = 'https://api.moocher.io/badip/IPV4/'
      response = HTTParty.get(base_url + ipaddress)
      response.success?
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
moocher-0.3.2 lib/moocher/ip.rb
moocher-0.2.2 lib/moocher/ip.rb
moocher-0.2.1.3 lib/moocher/ip.rb
moocher-0.2.1.2 lib/moocher/ip.rb
moocher-0.2.1.1 lib/moocher/ip.rb
moocher-0.2.1 lib/moocher/ip.rb
moocher-0.2 lib/moocher/ip.rb
moocher-0.1.1.7pre lib/moocher/ip.rb
moocher-0.1.1.6pre lib/moocher/ip.rb