sorbet/rbi/gems/maxmind-geoip2@1.1.0.rbi
# typed: true
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `maxmind-geoip2` gem.
# Please instead update this file by running `bin/tapioca gem maxmind-geoip2`.
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#3
module MaxMind; end
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#4
module MaxMind::GeoIP2; end
# Base error class for all errors that originate from the IP address
# itself and will not change when retried.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#11
class MaxMind::GeoIP2::AddressError < ::MaxMind::GeoIP2::Error; end
# An AddressInvalidError means the IP address was invalid.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#24
class MaxMind::GeoIP2::AddressInvalidError < ::MaxMind::GeoIP2::AddressError; end
# An AddressNotFoundError means the IP address was not found in the
# database or the web service said the IP address was not found.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#16
class MaxMind::GeoIP2::AddressNotFoundError < ::MaxMind::GeoIP2::AddressError; end
# An AddressReservedError means the IP address is reserved.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#28
class MaxMind::GeoIP2::AddressReservedError < ::MaxMind::GeoIP2::AddressError; end
# An AuthenticationError means there was a problem authenticating to the
# web service.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#33
class MaxMind::GeoIP2::AuthenticationError < ::MaxMind::GeoIP2::Error; end
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#56
class MaxMind::GeoIP2::Client
# Create a Client that may be used to query a GeoIP2 Precision web service.
#
# Once created, the Client is safe to use for lookups from multiple
# threads.
#
# @param account_id [Integer] your MaxMind account ID.
# @param license_key [String] your MaxMind license key.
# @param locales [Array<String>] a list of locale codes to use in the name
# property from most preferred to least preferred.
# @param host [String] the host to use when querying the web service. Set
# this to "geolite.info" to use the GeoLite2 web service instead of
# GeoIP2 Precision.
# @param timeout [Integer] the number of seconds to wait for a request
# before timing out. If 0, no timeout is set.
# @param proxy_address [String] proxy address to use, if any.
# @param proxy_port [Integer] proxy port to use, if any.
# @param proxy_username [String] proxy username to use, if any.
# @param proxy_password [String] proxy password to use, if any.
# @param pool_size [Integer] HTTP connection pool size
# @return [Client] a new instance of Client
#
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#89
def initialize(account_id:, license_key:, locales: T.unsafe(nil), host: T.unsafe(nil), timeout: T.unsafe(nil), proxy_address: T.unsafe(nil), proxy_port: T.unsafe(nil), proxy_username: T.unsafe(nil), proxy_password: T.unsafe(nil), pool_size: T.unsafe(nil)); end
# This method calls the City web service.
#
# @param ip_address [String] IPv4 or IPv6 address as a string. If no
# address is provided, the address that the web service is called from is
# used.
# @raise [HTTP::Error] if there was an error performing the HTTP request,
# such as an error connecting.
# @raise [JSON::ParserError] if there was invalid JSON in the response.
# @raise [HTTPError] if there was a problem with the HTTP response, such as
# an unexpected HTTP status code.
# @raise [AddressInvalidError] if the web service believes the IP address
# to be invalid or missing.
# @raise [AddressNotFoundError] if the IP address was not found.
# @raise [AddressReservedError] if the IP address is reserved.
# @raise [AuthenticationError] if there was a problem authenticating to the
# web service, such as an invalid or missing license key.
# @raise [InsufficientFundsError] if your account is out of credit.
# @raise [PermissionRequiredError] if your account does not have permission
# to use the web service.
# @raise [InvalidRequestError] if the web service responded with an error
# and there is no more specific error to raise.
# @return [MaxMind::GeoIP2::Model::City]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#153
def city(ip_address = T.unsafe(nil)); end
# This method calls the Country web service.
#
# @param ip_address [String] IPv4 or IPv6 address as a string. If no
# address is provided, the address that the web service is called from is
# used.
# @raise [HTTP::Error] if there was an error performing the HTTP request,
# such as an error connecting.
# @raise [JSON::ParserError] if there was invalid JSON in the response.
# @raise [HTTPError] if there was a problem with the HTTP response, such as
# an unexpected HTTP status code.
# @raise [AddressInvalidError] if the web service believes the IP address
# to be invalid or missing.
# @raise [AddressNotFoundError] if the IP address was not found.
# @raise [AddressReservedError] if the IP address is reserved.
# @raise [AuthenticationError] if there was a problem authenticating to the
# web service, such as an invalid or missing license key.
# @raise [InsufficientFundsError] if your account is out of credit.
# @raise [PermissionRequiredError] if your account does not have permission
# to use the web service.
# @raise [InvalidRequestError] if the web service responded with an error
# and there is no more specific error to raise.
# @return [MaxMind::GeoIP2::Model::Country]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#190
def country(ip_address = T.unsafe(nil)); end
# This method calls the Insights web service.
#
# Insights is only supported by the GeoIP2 Precision web service. The
# GeoLite2 web service does not support it.
#
# @param ip_address [String] IPv4 or IPv6 address as a string. If no
# address is provided, the address that the web service is called from is
# used.
# @raise [HTTP::Error] if there was an error performing the HTTP request,
# such as an error connecting.
# @raise [JSON::ParserError] if there was invalid JSON in the response.
# @raise [HTTPError] if there was a problem with the HTTP response, such as
# an unexpected HTTP status code.
# @raise [AddressInvalidError] if the web service believes the IP address
# to be invalid or missing.
# @raise [AddressNotFoundError] if the IP address was not found.
# @raise [AddressReservedError] if the IP address is reserved.
# @raise [AuthenticationError] if there was a problem authenticating to the
# web service, such as an invalid or missing license key.
# @raise [InsufficientFundsError] if your account is out of credit.
# @raise [PermissionRequiredError] if your account does not have permission
# to use the web service.
# @raise [InvalidRequestError] if the web service responded with an error
# and there is no more specific error to raise.
# @return [MaxMind::GeoIP2::Model::Insights]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#230
def insights(ip_address = T.unsafe(nil)); end
private
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#262
def get(endpoint, ip_address); end
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#292
def handle_client_error(endpoint, status, body, is_json); end
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#327
def handle_success(endpoint, body, is_json); end
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#242
def make_http_client; end
# source://maxmind-geoip2//lib/maxmind/geoip2/client.rb#236
def response_for(endpoint, model_class, ip_address); end
end
# Module's base error class
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#6
class MaxMind::GeoIP2::Error < ::StandardError; end
# An HTTPError means there was an unexpected HTTP status or response.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#20
class MaxMind::GeoIP2::HTTPError < ::MaxMind::GeoIP2::Error; end
# An InsufficientFundsError means the account is out of credits.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#37
class MaxMind::GeoIP2::InsufficientFundsError < ::MaxMind::GeoIP2::Error; end
# An InvalidRequestError means the web service returned an error and there
# is no more specific error class.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#47
class MaxMind::GeoIP2::InvalidRequestError < ::MaxMind::GeoIP2::Error; end
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#11
module MaxMind::GeoIP2::Model; end
# Model class for the GeoLite2 ASN database.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/asn.rb#9
class MaxMind::GeoIP2::Model::ASN < ::MaxMind::GeoIP2::Model::Abstract
# The autonomous system number associated with the IP address.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/asn.rb#13
def autonomous_system_number; end
# The organization associated with the registered autonomous system number
# for the IP address.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/asn.rb#21
def autonomous_system_organization; end
# The IP address that the data in the model is for.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/asn.rb#28
def ip_address; end
# 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.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/asn.rb#37
def network; end
end
# source://maxmind-geoip2//lib/maxmind/geoip2/model/abstract.rb#9
class MaxMind::GeoIP2::Model::Abstract
# @return [Abstract] a new instance of Abstract
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/abstract.rb#10
def initialize(record); end
protected
# source://maxmind-geoip2//lib/maxmind/geoip2/model/abstract.rb#19
def get(key); end
end
# Model class for the Anonymous IP database.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#9
class MaxMind::GeoIP2::Model::AnonymousIP < ::MaxMind::GeoIP2::Model::Abstract
# This is true if the IP address belongs to any sort of anonymous network.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#13
def anonymous?; end
# 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? method.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#23
def anonymous_vpn?; end
# This is true if the IP address belongs to a hosting or VPN provider (see
# description of the anonymous_vpn? method).
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#31
def hosting_provider?; end
# The IP address that the data in the model is for.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#38
def ip_address; end
# 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.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#47
def network; end
# This is true if the IP address belongs to a public proxy.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#54
def public_proxy?; end
# This is true if the IP address is on a suspected anonymizing network
# and belongs to a residential ISP.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#62
def residential_proxy?; end
# This is true if the IP address is a Tor exit node.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/anonymous_ip.rb#69
def tor_exit_node?; end
end
# Model class for the data returned by the GeoIP2 City web service and
# database. It is also used for GeoLite2 City lookups.
#
# The only difference between the City and Insights model classes is which
# fields in each record may be populated. See
# https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
#
# See {MaxMind::GeoIP2::Model::Country} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#20
class MaxMind::GeoIP2::Model::City < ::MaxMind::GeoIP2::Model::Country
# @return [City] a new instance of City
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#49
def initialize(record, locales); end
# City data for the IP address.
#
# @return [MaxMind::GeoIP2::Record::City]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#24
def city; end
# Location data for the IP address.
#
# @return [MaxMind::GeoIP2::Record::Location]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#29
def location; end
# The most specific subdivision returned.
#
# If the response did not contain any subdivisions, this method returns
# nil.
#
# @return [MaxMind::GeoIP2::Record::Subdivision, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#63
def most_specific_subdivision; end
# Postal data for the IP address.
#
# @return [MaxMind::GeoIP2::Record::Postal]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#34
def postal; end
# The country subdivisions for the IP address.
#
# The number and type of subdivisions varies by country, but a subdivision
# is typically a state, province, country, etc. Subdivisions are ordered
# from most general (largest) to most specific (smallest).
#
# If the response did not contain any subdivisions, this attribute will be
# an empty array.
#
# @return [Array<MaxMind::GeoIP2::Record::Subdivision>]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#46
def subdivisions; end
private
# source://maxmind-geoip2//lib/maxmind/geoip2/model/city.rb#69
def create_subdivisions(subdivisions, locales); end
end
# Model class for the GeoIP2 Connection Type database.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/connection_type.rb#9
class MaxMind::GeoIP2::Model::ConnectionType < ::MaxMind::GeoIP2::Model::Abstract
# The connection type may take the following values: "Dialup", "Cable/DSL",
# "Corporate", "Cellular". Additional values may be added in the future.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/connection_type.rb#14
def connection_type; end
# The IP address that the data in the model is for.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/connection_type.rb#21
def ip_address; end
# 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.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/connection_type.rb#30
def network; end
end
# Model class for the data returned by the GeoIP2 Country web service and
# database. It is also used for GeoLite2 Country lookups.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#14
class MaxMind::GeoIP2::Model::Country
# @return [Country] a new instance of Country
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#51
def initialize(record, locales); end
# Continent data for the IP address.
#
# @return [MaxMind::GeoIP2::Record::Continent]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#18
def continent; end
# Country data for the IP address. This object represents the country where
# MaxMind believes the end user is located.
#
# @return [MaxMind::GeoIP2::Record::Country]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#24
def country; end
# Data related to your MaxMind account.
#
# @return [MaxMind::GeoIP2::Record::MaxMind]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#29
def maxmind; end
# Registered country data for the IP address. This record represents the
# country where the ISP has registered a given IP block and may differ from
# the user's country.
#
# @return [MaxMind::GeoIP2::Record::Country]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#36
def registered_country; end
# Represented country data for the IP address. The represented country is
# used for things like military bases. It is only present when the
# represented country differs from the country.
#
# @return [MaxMind::GeoIP2::Record::RepresentedCountry]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#43
def represented_country; end
# Data for the traits of the IP address.
#
# @return [MaxMind::GeoIP2::Record::Traits]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/country.rb#48
def traits; end
end
# Model class for the GeoIP2 Domain database.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/domain.rb#9
class MaxMind::GeoIP2::Model::Domain < ::MaxMind::GeoIP2::Model::Abstract
# The second level domain associated with the IP address. This will be
# something like "example.com" or "example.co.uk", not "foo.example.com".
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/domain.rb#14
def domain; end
# The IP address that the data in the model is for.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/domain.rb#21
def ip_address; end
# 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.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/domain.rb#30
def network; end
end
# Model class for the data returned by GeoIP2 Enterprise database lookups.
#
# The only difference between the City and Insights model classes is which
# fields in each record may be populated. See
# https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
#
# See {MaxMind::GeoIP2::Model::City} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/enterprise.rb#15
class MaxMind::GeoIP2::Model::Enterprise < ::MaxMind::GeoIP2::Model::City; end
# Model class for the GeoIP2 ISP database.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#9
class MaxMind::GeoIP2::Model::ISP < ::MaxMind::GeoIP2::Model::Abstract
# The autonomous system number associated with the IP address.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#13
def autonomous_system_number; end
# The organization associated with the registered autonomous system number
# for the IP address.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#21
def autonomous_system_organization; end
# The IP address that the data in the model is for.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#28
def ip_address; end
# The name of the ISP associated with the IP address.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#35
def isp; end
# The {https://en.wikipedia.org/wiki/Mobile_country_code mobile country
# code (MCC)} associated with the IP address and ISP.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#43
def mobile_country_code; end
# The {https://en.wikipedia.org/wiki/Mobile_country_code mobile network
# code (MNC)} associated with the IP address and ISP.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#51
def mobile_network_code; end
# 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.
#
# @return [String]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#60
def network; end
# The name of the organization associated with the IP address.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/isp.rb#67
def organization; end
end
# Model class for the data returned by the GeoIP2 Precision Insights web
# service.
#
# The only difference between the City and Insights model classes is which
# fields in each record may be populated. See
# https://dev.maxmind.com/geoip/docs/web-services?lang=en for more details.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/model/insights.rb#14
class MaxMind::GeoIP2::Model::Insights < ::MaxMind::GeoIP2::Model::City; end
# A PermissionRequiredError means the account does not have permission to
# use the requested service.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/errors.rb#42
class MaxMind::GeoIP2::PermissionRequiredError < ::MaxMind::GeoIP2::Error; end
# Reader is a reader for the GeoIP2/GeoLite2 database format. IP addresses
# can be looked up using the database specific methods.
#
# == Example
#
# require 'maxmind/geoip2'
#
# reader = MaxMind::GeoIP2::Reader.new(database: 'GeoIP2-Country.mmdb')
#
# record = reader.country('1.2.3.4')
# puts record.country.iso_code
#
# reader.close
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#29
class MaxMind::GeoIP2::Reader
# Create a Reader for looking up IP addresses in a GeoIP2/GeoLite2 database
# file.
#
# If you're performing multiple lookups, it's most efficient to create one
# Reader and reuse it.
#
# Once created, the Reader is safe to use for lookups from multiple
# threads. It is safe to use after forking.
#
# @overload initialize
# @raise [MaxMind::DB::InvalidDatabaseError] if the database is corrupt
# or invalid.
# @raise [ArgumentError] if the mode is invalid.
# @return [Reader] a new instance of Reader
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#56
def initialize(*args); end
# Look up the IP address in the database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-Anonymous IP database or if
# you attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::AnonymousIP]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#104
def anonymous_ip(ip_address); end
# Look up the IP address in an ASN database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-ASN database or if you
# attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::ASN]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#128
def asn(ip_address); end
# Look up the IP address in a City database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-City database or if you
# attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::City]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#147
def city(ip_address); end
# Close the Reader and return resources to the system.
#
# @return [void]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#261
def close; end
# Look up the IP address in a Connection Type database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-Connection Type database or if
# you attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::ConnectionType]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#166
def connection_type(ip_address); end
# Look up the IP address in a Country database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-Country database or if you
# attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::Country]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#190
def country(ip_address); end
# Look up the IP address in a Domain database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-Domain database or if you
# attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::Domain]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#209
def domain(ip_address); end
# Look up the IP address in an Enterprise database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-Enterprise database or if
# you attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::Enterprise]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#228
def enterprise(ip_address); end
# Look up the IP address in an ISP database.
#
# @param ip_address [String] a string in the standard notation. It may be
# IPv4 or IPv6.
# @raise [ArgumentError] if used against a non-ISP database or if you
# attempt to look up an IPv6 address in an IPv4 only database.
# @raise [AddressNotFoundError] if the IP address is not found in the
# database.
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
# @return [MaxMind::GeoIP2::Model::ISP]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#247
def isp(ip_address); end
# Return the metadata associated with the database.
#
# @return [MaxMind::DB::Metadata]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#254
def metadata; end
private
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#293
def flat_model_for(model_class, method, type, ip_address); end
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#277
def get_record(method, type, ip_address); end
# source://maxmind-geoip2//lib/maxmind/geoip2/reader.rb#267
def model_for(model_class, method, type, ip_address); end
end
# source://maxmind-geoip2//lib/maxmind/geoip2/record/abstract.rb#5
module MaxMind::GeoIP2::Record; end
# source://maxmind-geoip2//lib/maxmind/geoip2/record/abstract.rb#7
class MaxMind::GeoIP2::Record::Abstract
# @return [Abstract] a new instance of Abstract
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/abstract.rb#8
def initialize(record); end
protected
# source://maxmind-geoip2//lib/maxmind/geoip2/record/abstract.rb#14
def get(key); end
end
# City-level data associated with an IP address.
#
# This record is returned by all location services and databases besides
# Country.
#
# See {MaxMind::GeoIP2::Record::Place} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/city.rb#14
class MaxMind::GeoIP2::Record::City < ::MaxMind::GeoIP2::Record::Place
# A value from 0-100 indicating MaxMind's confidence that the city is
# correct. This attribute is only available from the Insights service and
# the GeoIP2 Enterprise database.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/city.rb#20
def confidence; end
# The GeoName ID for the city. This attribute is returned by all location
# services and databases.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/city.rb#28
def geoname_id; end
# A Hash where the keys are locale codes and the values are names. This
# attribute is returned by all location services and databases.
#
# @return [Hash<String, String>, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/city.rb#36
def names; end
end
# Contains data for the continent record associated with an IP address.
#
# This record is returned by all location services and databases.
#
# See {MaxMind::GeoIP2::Record::Place} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/continent.rb#13
class MaxMind::GeoIP2::Record::Continent < ::MaxMind::GeoIP2::Record::Place
# A two character continent code like "NA" (North America) or "OC"
# (Oceania). This attribute is returned by all location services and
# databases.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/continent.rb#19
def code; end
# The GeoName ID for the continent. This attribute is returned by all
# location services and databases.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/continent.rb#27
def geoname_id; end
# A Hash where the keys are locale codes and the values are names. This
# attribute is returned by all location services and databases.
#
# @return [Hash<String, String>, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/continent.rb#35
def names; end
end
# Contains data for the country record associated with an IP address.
#
# This record is returned by all location services and databases.
#
# See {MaxMind::GeoIP2::Record::Place} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/country.rb#13
class MaxMind::GeoIP2::Record::Country < ::MaxMind::GeoIP2::Record::Place
# A value from 0-100 indicating MaxMind's confidence that the country is
# correct. This attribute is only available from the Insights service and
# the GeoIP2 Enterprise database.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/country.rb#19
def confidence; end
# The GeoName ID for the country. This attribute is returned by all
# location services and databases.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/country.rb#27
def geoname_id; end
# This is true if the country is a member state of the European Union. This
# attribute is returned by all location services and databases.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/country.rb#35
def in_european_union?; end
# The two-character ISO 3166-1 alpha code for the country. See
# https://en.wikipedia.org/wiki/ISO_3166-1. This attribute is returned by
# all location services and databases.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/country.rb#44
def iso_code; end
# A Hash where the keys are locale codes and the values are names. This
# attribute is returned by all location services and databases.
#
# @return [Hash<String, String>, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/country.rb#52
def names; end
end
# Contains data for the location record associated with an IP address.
#
# This record is returned by all location services and databases besides
# Country.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#12
class MaxMind::GeoIP2::Record::Location < ::MaxMind::GeoIP2::Record::Abstract
# The approximate accuracy radius in kilometers around the latitude and
# longitude for the IP address. This is the radius where we have a 67%
# confidence that the device using the IP address resides within the circle
# centered at the latitude and longitude with the provided radius.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#19
def accuracy_radius; end
# The average income in US dollars associated with the requested IP
# address. This attribute is only available from the Insights service.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#27
def average_income; end
# The approximate latitude of the location associated with the IP address.
# This value is not precise and should not be used to identify a particular
# address or household.
#
# @return [Float, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#36
def latitude; end
# The approximate longitude of the location associated with the IP address.
# This value is not precise and should not be used to identify a particular
# address or household.
#
# @return [Float, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#45
def longitude; end
# The metro code of the location if the location is in the US. MaxMind
# returns the same metro codes as the Google AdWords API. See
# https://developers.google.com/adwords/api/docs/appendix/cities-DMAregions.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#54
def metro_code; end
# The estimated population per square kilometer associated with the IP
# address. This attribute is only available from the Insights service.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#62
def population_density; end
# The time zone associated with location, as specified by the IANA Time
# Zone Database, e.g., "America/New_York". See
# https://www.iana.org/time-zones.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/location.rb#71
def time_zone; end
end
# Contains data about your account.
#
# This record is returned by all location services.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/maxmind.rb#11
class MaxMind::GeoIP2::Record::MaxMind < ::MaxMind::GeoIP2::Record::Abstract
# The number of remaining queries you have for the service you are calling.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/maxmind.rb#15
def queries_remaining; end
end
# Location data common to different location types.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/place.rb#9
class MaxMind::GeoIP2::Record::Place < ::MaxMind::GeoIP2::Record::Abstract
# @return [Place] a new instance of Place
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/place.rb#11
def initialize(record, locales); end
# The first available localized name in order of preference.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/place.rb#19
def name; end
end
# Contains data for the postal record associated with an IP address.
#
# This record is returned by all location services and databases besides
# Country.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/postal.rb#12
class MaxMind::GeoIP2::Record::Postal < ::MaxMind::GeoIP2::Record::Abstract
# The postal code of the location. Postal codes are not available for all
# countries. In some countries, this will only contain part of the postal
# code. This attribute is returned by all location databases and services
# besides Country.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/postal.rb#19
def code; end
# A value from 0-100 indicating MaxMind's confidence that the postal code
# is correct. This attribute is only available from the Insights service
# and the GeoIP2 Enterprise database.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/postal.rb#28
def confidence; end
end
# Contains data for the represented country associated with an IP address.
#
# This class contains the country-level data associated with an IP address
# for the IP's represented country. The represented country is the country
# represented by something like a military base.
#
# See {MaxMind::GeoIP2::Record::Country} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/represented_country.rb#15
class MaxMind::GeoIP2::Record::RepresentedCountry < ::MaxMind::GeoIP2::Record::Country
# A string indicating the type of entity that is representing the country.
# Currently we only return +military+ but this could expand to include
# other types in the future.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/represented_country.rb#21
def type; end
end
# Contains data for the subdivisions associated with an IP address.
#
# This record is returned by all location databases and services besides
# Country.
#
# See {MaxMind::GeoIP2::Record::Place} for inherited methods.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/subdivision.rb#14
class MaxMind::GeoIP2::Record::Subdivision < ::MaxMind::GeoIP2::Record::Place
# This is a value from 0-100 indicating MaxMind's confidence that the
# subdivision is correct. This attribute is only available from the
# Insights service and the GeoIP2 Enterprise database.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/subdivision.rb#20
def confidence; end
# This is a GeoName ID for the subdivision. This attribute is returned by
# all location databases and services besides Country.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/subdivision.rb#28
def geoname_id; end
# This is a string up to three characters long contain the subdivision
# portion of the ISO 3166-2 code. See
# https://en.wikipedia.org/wiki/ISO_3166-2. This attribute is returned by
# all location databases and services except Country.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/subdivision.rb#38
def iso_code; end
# A Hash where the keys are locale codes and the values are names. This attribute is returned by all location services and
# databases besides country.
#
# @return [Hash<String, String>, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/subdivision.rb#46
def names; end
end
# Contains data for the traits record associated with an IP address.
#
# This record is returned by all location services and databases.
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#12
class MaxMind::GeoIP2::Record::Traits < ::MaxMind::GeoIP2::Record::Abstract
# @return [Traits] a new instance of Traits
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#14
def initialize(record); end
# This is true if the IP address belongs to any sort of anonymous network.
# This property is only available from GeoIP2 Precision Insights.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#79
def anonymous?; end
# 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 GeoIP2
# Precision Insights.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#90
def anonymous_vpn?; end
# The autonomous system number associated with the IP address. See
# Wikipedia[https://en.wikipedia.org/wiki/Autonomous_system_(Internet)].
# This attribute is only available from the City and Insights web service
# and the GeoIP2 Enterprise database.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#29
def autonomous_system_number; end
# The organization associated with the registered autonomous system number
# for the IP address. See
# Wikipedia[https://en.wikipedia.org/wiki/Autonomous_system_(Internet)].
# This attribute is only available from the City and Insights web service
# and the GeoIP2 Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#40
def autonomous_system_organization; end
# The connection type may take the following values: "Dialup",
# "Cable/DSL", "Corporate", "Cellular". Additional values may be added in
# the future. This attribute is only available in the GeoIP2 Enterprise
# database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#50
def connection_type; end
# 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 and Insights web service
# and the GeoIP2 Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#60
def domain; end
# 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 GeoIP2 Precision Insights.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#99
def hosting_provider?; end
# 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.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#71
def ip_address; end
# The name of the ISP associated with the IP address. This attribute is
# only available from the City and Insights web services and the GeoIP2
# Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#164
def isp; end
# 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 GeoIP2 Enterprise database.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#108
def legitimate_proxy?; end
# The {https://en.wikipedia.org/wiki/Mobile_country_code mobile country
# code (MCC)} associated with the IP address and ISP.
#
# This attribute is only available from the City and Insights web service
# and the GeoIP2 Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#119
def mobile_country_code; end
# The {https://en.wikipedia.org/wiki/Mobile_country_code mobile network
# code (MNC)} associated with the IP address and ISP.
#
# This attribute is only available from the City and Insights web service
# and the GeoIP2 Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#130
def mobile_network_code; end
# 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.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#173
def network; end
# The name of the organization associated with the IP address. This
# attribute is only available from the City and Insights web services and
# the GeoIP2 Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#182
def organization; end
# This is true if the IP address belongs to a public proxy. This property
# is only available from GeoIP2 Precision Insights.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#138
def public_proxy?; end
# 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 GeoIP2 Precision Insights.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#147
def residential_proxy?; end
# An indicator of how static or dynamic an IP address is. This property is
# only available from GeoIP2 Precision Insights.
#
# @return [Float, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#190
def static_ip_score; end
# This is true if the IP address is a Tor exit node. This property is only
# available from GeoIP2 Precision Insights.
#
# @return [Boolean]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#155
def tor_exit_node?; end
# 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 GeoIP2
# Precision Insights.
#
# @return [Integer, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#200
def user_count; end
# The user type associated with the IP address. This can be one of the
# following values:
#
# * business
# * cafe
# * cellular
# * college
# * 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
# GeoIP2 Enterprise database.
#
# @return [String, nil]
#
# source://maxmind-geoip2//lib/maxmind/geoip2/record/traits.rb#227
def user_type; end
end