lib/onyphe/clients/inetnum.rb in onyphe-0.1.0 vs lib/onyphe/clients/inetnum.rb in onyphe-0.2.0
- old
+ new
@@ -2,9 +2,11 @@
module Onyphe
module Clients
class Inetnum < Client
def get_by_ip(ip, page = 1)
+ raise ArgumentError, "Invalid IP address: #{ip}" unless Validator.valid_ip?(ip)
+
get("/inetnum/#{ip}", page: page) { |json| json }
end
end
end
end