Class: MaxMind::GeoIP2::Record::Anonymizer

Inherits:
Abstract
  • Object
show all
Defined in:
lib/maxmind/geoip2/record/anonymizer.rb

Overview

Contains data indicating whether an IP address is part of an anonymizing network.

This record is returned by the Insights web service.

Instance Method Summary collapse

Instance Method Details

#anonymous?Boolean

This is true if the IP address belongs to any sort of anonymous network. This property is only available from Insights.

Returns:

  • (Boolean)


27
28
29
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 27

def anonymous?
  get('is_anonymous')
end

#anonymous_vpn?Boolean

This is true if the IP address is registered to an anonymous VPN provider. If a VPN provider does not register subnets under names associated with them, we will likely only flag their IP ranges using the hosting_provider? property. This property is only available from Insights.

Returns:

  • (Boolean)


38
39
40
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 38

def anonymous_vpn?
  get('is_anonymous_vpn')
end

#confidenceInteger?

A score ranging from 1 to 99 that represents our percent confidence that the network is currently part of an actively used VPN service. This property is only available from Insights.

Returns:

  • (Integer, nil)


19
20
21
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 19

def confidence
  get('confidence')
end

#hosting_provider?Boolean

This is true if the IP address belongs to a hosting or VPN provider (see description of the anonymous_vpn? property). This property is only available from Insights.

Returns:

  • (Boolean)


47
48
49
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 47

def hosting_provider?
  get('is_hosting_provider')
end

#network_last_seenDate?

The last day that the network was sighted in our analysis of anonymized networks. This value is parsed lazily. This property is only available from Insights.

Returns:

  • (Date, nil)

    A Date object representing the last seen date, or nil if the date is not available.



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 82

def network_last_seen
  return @network_last_seen if defined?(@network_last_seen)

  date_string = get('network_last_seen')

  if !date_string
    return nil
  end

  @network_last_seen = Date.parse(date_string)
end

#provider_nameString?

The name of the VPN provider (e.g., NordVPN, SurfShark, etc.) associated with the network. This property is only available from Insights.

Returns:

  • (String, nil)


99
100
101
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 99

def provider_name
  get('provider_name')
end

#public_proxy?Boolean

This is true if the IP address belongs to a public proxy. This property is only available from Insights.

Returns:

  • (Boolean)


55
56
57
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 55

def public_proxy?
  get('is_public_proxy')
end

#residential_proxy?Boolean

This is true if the IP address is on a suspected anonymizing network and belongs to a residential ISP. This property is only available from Insights.

Returns:

  • (Boolean)


64
65
66
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 64

def residential_proxy?
  get('is_residential_proxy')
end

#tor_exit_node?Boolean

This is true if the IP address is a Tor exit node. This property is only available from Insights.

Returns:

  • (Boolean)


72
73
74
# File 'lib/maxmind/geoip2/record/anonymizer.rb', line 72

def tor_exit_node?
  get('is_tor_exit_node')
end