Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 51 additions & 39 deletions lib/maxmind/geoip2/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,30 @@ def initialize(
#
# @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 [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::AddressInvalidError] if the web service believes
# the IP address to be invalid or missing.
#
# @raise [AddressNotFoundError] if the IP address was not found.
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address was not
# found.
#
# @raise [AddressReservedError] if the IP address is reserved.
# @raise [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::InsufficientFundsError] if your account is out
# of credit.
#
# @raise [PermissionRequiredError] if your account does not have permission
# to use the web service.
# @raise [MaxMind::GeoIP2::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.
# @raise [MaxMind::GeoIP2::InvalidRequestError] if the web service
# responded with an error and there is no more specific error to raise.
#
# @return [MaxMind::GeoIP2::Model::City]
def city(ip_address = 'me')
Expand All @@ -169,26 +173,30 @@ def city(ip_address = 'me')
#
# @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 [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::AddressInvalidError] if the web service believes
# the IP address to be invalid or missing.
#
# @raise [AddressNotFoundError] if the IP address was not found.
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address was not
# found.
#
# @raise [AddressReservedError] if the IP address is reserved.
# @raise [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::InsufficientFundsError] if your account is out
# of credit.
#
# @raise [PermissionRequiredError] if your account does not have permission
# to use the web service.
# @raise [MaxMind::GeoIP2::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.
# @raise [MaxMind::GeoIP2::InvalidRequestError] if the web service
# responded with an error and there is no more specific error to raise.
#
# @return [MaxMind::GeoIP2::Model::Country]
def country(ip_address = 'me')
Expand All @@ -209,26 +217,30 @@ def country(ip_address = 'me')
#
# @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 [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::AddressInvalidError] if the web service believes
# the IP address to be invalid or missing.
#
# @raise [AddressNotFoundError] if the IP address was not found.
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address was not
# found.
#
# @raise [AddressReservedError] if the IP address is reserved.
# @raise [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::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 [MaxMind::GeoIP2::InsufficientFundsError] if your account is out
# of credit.
#
# @raise [PermissionRequiredError] if your account does not have permission
# to use the web service.
# @raise [MaxMind::GeoIP2::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.
# @raise [MaxMind::GeoIP2::InvalidRequestError] if the web service
# responded with an error and there is no more specific error to raise.
#
# @return [MaxMind::GeoIP2::Model::Insights]
def insights(ip_address = 'me')
Expand Down
36 changes: 18 additions & 18 deletions lib/maxmind/geoip2/reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def initialize(*args)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -121,8 +121,8 @@ def anonymous_ip(ip_address)
# @raise [ArgumentError] if used against a non-Anonymous Plus 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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -145,8 +145,8 @@ def anonymous_plus(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -164,8 +164,8 @@ def asn(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -183,8 +183,8 @@ def city(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -207,8 +207,8 @@ def connection_type(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -226,8 +226,8 @@ def country(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -245,8 +245,8 @@ def domain(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand All @@ -264,8 +264,8 @@ def enterprise(ip_address)
# @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::GeoIP2::AddressNotFoundError] if the IP address is not
# found in the database.
#
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
# corrupt.
Expand Down
Loading