Class: Ipregistry::Models::IpInfo

Inherits:
Base
  • Object
show all
Defined in:
lib/ipregistry/models/ip_info.rb

Overview

The comprehensive set of information associated with an IP address returned by the Ipregistry API.

Nested objects (carrier, company, connection, currency, location, security, and time_zone) are always present, so chained access never raises even when the API omitted them; absent fields return nil.

Direct Known Subclasses

RequesterIpInfo

Instance Method Summary collapse

Methods inherited from Base

#==, #[], #hash, #initialize, #inspect, #to_h

Constructor Details

This class inherits a constructor from Ipregistry::Models::Base

Instance Method Details

#ipv4?Boolean

Returns:

  • (Boolean)


90
# File 'lib/ipregistry/models/ip_info.rb', line 90

def ipv4? = @data["type"] == "IPv4"

#ipv6?Boolean

Returns:

  • (Boolean)


92
# File 'lib/ipregistry/models/ip_info.rb', line 92

def ipv6? = @data["type"] == "IPv6"