Class: MaxMind::GeoIP2::Model::Domain

Inherits:
Abstract
  • Object
show all
Defined in:
lib/maxmind/geoip2/model/domain.rb

Overview

Model class for the GeoIP2 Domain database.

Instance Method Summary collapse

Instance Method Details

#domainString?

The second level domain associated with the IP address. This will be something like “example.com” or “example.co.uk”, not “foo.example.com”.

Returns:

  • (String, nil)


14
15
16
# File 'lib/maxmind/geoip2/model/domain.rb', line 14

def domain
  get('domain')
end

#ip_addressString

The IP address that the data in the model is for.

Returns:

  • (String)


21
22
23
# File 'lib/maxmind/geoip2/model/domain.rb', line 21

def ip_address
  get('ip_address')
end

#networkString

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.

Returns:

  • (String)


30
31
32
# File 'lib/maxmind/geoip2/model/domain.rb', line 30

def network
  get('network')
end