Class: MaxMind::GeoIP2::Record::Traits
- Inherits:
-
Abstract
- Object
- Abstract
- MaxMind::GeoIP2::Record::Traits
- Defined in:
- lib/maxmind/geoip2/record/traits.rb
Overview
Contains data for the traits record associated with an IP address.
This record is returned by all location services and databases.
Instance Method Summary collapse
-
#anonymous? ⇒ Boolean
deprecated
Deprecated.
since 1.4.0
-
#anonymous_vpn? ⇒ Boolean
deprecated
Deprecated.
since 1.4.0
-
#anycast? ⇒ Boolean
This is true if the IP address belongs to an anycast network.
-
#autonomous_system_number ⇒ Integer?
The autonomous system number associated with the IP address.
-
#autonomous_system_organization ⇒ String?
The organization associated with the registered autonomous system number for the IP address.
-
#connection_type ⇒ String?
The connection type may take the following values: “Dialup”, “Cable/DSL”, “Corporate”, “Cellular”, and “Satellite”.
-
#domain ⇒ String?
The second level domain associated with the IP address.
-
#hosting_provider? ⇒ Boolean
deprecated
Deprecated.
since 1.4.0
-
#ip_address ⇒ String?
The IP address that the data in the model is for.
-
#ip_risk_snapshot ⇒ Float?
This field contains the risk associated with the IP address.
-
#isp ⇒ String?
The name of the ISP associated with the IP address.
-
#legitimate_proxy? ⇒ Boolean
This attribute is true if MaxMind believes this IP address to be a legitimate proxy, such as an internal VPN used by a corporation.
-
#mobile_country_code ⇒ String?
The mobile country code (MCC) associated with the IP address and ISP.
-
#mobile_network_code ⇒ String?
The mobile network code (MNC) associated with the IP address and ISP.
-
#network ⇒ String?
The network in CIDR notation associated with the record.
-
#organization ⇒ String?
The name of the organization associated with the IP address.
-
#public_proxy? ⇒ Boolean
deprecated
Deprecated.
since 1.4.0
-
#residential_proxy? ⇒ Boolean
deprecated
Deprecated.
since 1.4.0
-
#static_ip_score ⇒ Float?
An indicator of how static or dynamic an IP address is.
-
#tor_exit_node? ⇒ Boolean
deprecated
Deprecated.
since 1.4.0
-
#user_count ⇒ Integer?
The estimated number of users sharing the IP/network during the past 24 hours.
-
#user_type ⇒ String?
The user type associated with the IP address.
Instance Method Details
#anonymous? ⇒ Boolean
since 1.4.0
This is true if the IP address belongs to any sort of anonymous network. This property is only available from Insights.
This method is deprecated as of version 1.4.0. Use the anonymizer object from the Insights response instead.
84 85 86 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 84 def anonymous? get('is_anonymous') end |
#anonymous_vpn? ⇒ Boolean
since 1.4.0
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.
This method is deprecated as of version 1.4.0. Use the anonymizer object from the Insights response instead.
98 99 100 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 98 def anonymous_vpn? get('is_anonymous_vpn') end |
#anycast? ⇒ Boolean
This is true if the IP address belongs to an anycast network.
This property is only available from the Country, City Plus, and Insights web services and the GeoIP2 Country, City, and Enterprise databases.
110 111 112 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 110 def anycast? get('is_anycast') end |
#autonomous_system_number ⇒ Integer?
The autonomous system number associated with the IP address. See Wikipedia. This attribute is only available from the City Plus and Insights web services and the Enterprise database.
29 30 31 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 29 def autonomous_system_number get('autonomous_system_number') end |
#autonomous_system_organization ⇒ String?
The organization associated with the registered autonomous system number for the IP address. See Wikipedia. This attribute is only available from the City Plus and Insights web services and the Enterprise database.
40 41 42 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 40 def autonomous_system_organization get('autonomous_system_organization') end |
#connection_type ⇒ String?
The connection type may take the following values: “Dialup”, “Cable/DSL”, “Corporate”, “Cellular”, and “Satellite”. Additional values may be added in the future. This attribute is only available from the City Plus and Insights web services and the Enterprise database.
51 52 53 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 51 def connection_type get('connection_type') end |
#domain ⇒ String?
The second level domain associated with the IP address. This will be something like “example.com” or “example.co.uk”, not “foo.example.com”. This attribute is only available from the City Plus and Insights web services and the Enterprise database.
61 62 63 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 61 def domain get('domain') end |
#hosting_provider? ⇒ Boolean
since 1.4.0
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.
This method is deprecated as of version 1.4.0. Use the anonymizer object from the Insights response instead.
123 124 125 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 123 def hosting_provider? get('is_hosting_provider') end |
#ip_address ⇒ String?
The IP address that the data in the model is for. If you performed a “me” lookup against the web service, this will be the externally routable IP address for the system the code is running on. If the system is behind a NAT, this may differ from the IP address locally assigned to it. This attribute is returned by all end points.
72 73 74 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 72 def ip_address get('ip_address') end |
#ip_risk_snapshot ⇒ Float?
This field contains the risk associated with the IP address. The value ranges from 0.01 to 99. A higher score indicates a higher risk. Please note that the IP risk score provided in GeoIP products and services is more static than the IP risk score provided in minFraud and is not responsive to traffic on your network. If you need realtime IP risk scoring based on behavioral signals on your own network, please use minFraud. This property is only available from Insights.
248 249 250 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 248 def ip_risk_snapshot get('ip_risk_snapshot') end |
#isp ⇒ String?
The name of the ISP associated with the IP address. This attribute is only available from the City Plus and Insights web services and the Enterprise database.
200 201 202 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 200 def isp get('isp') end |
#legitimate_proxy? ⇒ Boolean
This attribute is true if MaxMind believes this IP address to be a legitimate proxy, such as an internal VPN used by a corporation. This attribute is only available in the Enterprise database.
132 133 134 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 132 def legitimate_proxy? get('is_legitimate_proxy') end |
#mobile_country_code ⇒ String?
The mobile country code (MCC) associated with the IP address and ISP.
This attribute is only available from the City Plus and Insights web services and the Enterprise database.
143 144 145 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 143 def mobile_country_code get('mobile_country_code') end |
#mobile_network_code ⇒ String?
The mobile network code (MNC) associated with the IP address and ISP.
This attribute is only available from the City Plus and Insights web services and the Enterprise database.
154 155 156 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 154 def mobile_network_code get('mobile_network_code') end |
#network ⇒ String?
The network in CIDR notation associated with the record. In particular, this is the largest network where all of the fields besides ip_address have the same value.
209 210 211 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 209 def network get('network') end |
#organization ⇒ String?
The name of the organization associated with the IP address. This attribute is only available from the City Plus and Insights web services and the Enterprise database.
218 219 220 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 218 def organization get('organization') end |
#public_proxy? ⇒ Boolean
since 1.4.0
This is true if the IP address belongs to a public proxy. This property is only available from Insights.
This method is deprecated as of version 1.4.0. Use the anonymizer object from the Insights response instead.
166 167 168 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 166 def public_proxy? get('is_public_proxy') end |
#residential_proxy? ⇒ Boolean
since 1.4.0
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.
This method is deprecated as of version 1.4.0. Use the anonymizer object from the Insights response instead.
179 180 181 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 179 def residential_proxy? get('is_residential_proxy') end |
#static_ip_score ⇒ Float?
An indicator of how static or dynamic an IP address is. This property is only available from Insights.
226 227 228 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 226 def static_ip_score get('static_ip_score') end |
#tor_exit_node? ⇒ Boolean
since 1.4.0
This is true if the IP address is a Tor exit node. This property is only available from Insights.
This method is deprecated as of version 1.4.0. Use the anonymizer object from the Insights response instead.
191 192 193 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 191 def tor_exit_node? get('is_tor_exit_node') end |
#user_count ⇒ Integer?
The estimated number of users sharing the IP/network during the past 24 hours. For IPv4, the count is for the individual IP. For IPv6, the count is for the /64 network. This property is only available from Insights.
235 236 237 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 235 def user_count get('user_count') end |
#user_type ⇒ String?
The user type associated with the IP address. This can be one of the following values:
-
business
-
cafe
-
cellular
-
college
-
consumer_privacy_network
-
content_delivery_network
-
dialup
-
government
-
hosting
-
library
-
military
-
residential
-
router
-
school
-
search_engine_spider
-
traveler
This attribute is only available from the Insights web service and the Enterprise database.
276 277 278 |
# File 'lib/maxmind/geoip2/record/traits.rb', line 276 def user_type get('user_type') end |