Class: Barometer::Query::Format::Ipv4Address

Inherits:
Base
  • Object
show all
Defined in:
lib/barometer/query/formats/ipv4_address.rb

Overview

eg. 8.8.8.8

Class Method Summary collapse

Methods inherited from Base

convert_query, geo, regex

Class Method Details

.is?(query) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/barometer/query/formats/ipv4_address.rb', line 10

def self.is?(query)
  (ipaddr = IPAddr.new(query.to_s)) && ipaddr.ipv4?
rescue ArgumentError
end