GeoIP2...ntinent(3pm)

πŸ“¦
version 2.006002 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Okay bestie, welcome to GeoIP2::Record::Continent πŸ’– β€” it's the little record class that holds all the continent-level tea for whatever IP address you threw at it. It lives in the User Contributed Perl Documentation corner of your manual pages (yes, that's a 3pm situation), and it's here to hand you continent data like it's nothing.


🌸 VERSION 🌸

This is version 2.006002 β€” that's the one you're reading rn, no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the whole vibe, literally copy-paste energy:

use 5.008;

use GeoIP2::WebService::Client;

my $client = GeoIP2::WebService::Client->new(
    account_id  => 42,
    license_key => 'abcdef123456',
);

my $insights = $client->insights( ip => '24.24.24.24' );

my $continent_rec = $insights->continent();
print $continent_rec->name(), "\n";

See? You spin up a client, you ask it about an IP, you pull the continent record off the insights, and you print a name. Main character behavior, honestly. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

This class is holding continent-level data that's associated with an IP address. That's its whole job and it does it gorgeously.

The glow-up detail you need to know: this record is returned by all the end points. Every single one. It never ghosts you. πŸ’–


✨ METHODS ✨

Here's the menu, bestie. This class provides the following methods:

πŸ’œ $continent_rec->code()

This one hands you a two character continent code, like "NA" (that's North America, hi) or "OC" (Oceania, hey girl).

This attribute is returned by all end points.

🌈 $continent_rec->geoname_id()

Returns a "geoname_id" for the continent. That's the identifier, the receipts, the little number that says this continent, specifically. πŸ”₯

This attribute is returned by all end points.

πŸŽ€ $continent_rec->name()

Returns a name for the continent. Now here's the cute part β€” the locale chosen depends on the "locales" argument that was passed to the record's constructor. And that argument gets passed through from the GeoIP2::WebService::Client object you used to fetch the data that populated this record. So like, the locale vibes travel all the way down from your client. It's giving inheritance of intentions. ✨

Heads up though: if the record doesn't have a name in any of the locales you asked for, this method returns "undef". Not an error, not a crash, just undef. Don't be dramatic about it (I would be, but you shouldn't). 😭

This attribute is returned by all end points.

🫢 $continent_rec->names()

Returns a hash reference where the keys are locale codes and the values are names. So it's like the whole squad of names, all the locales at once, one big group chat. πŸ’¬

Wanna know which locale codes are even possible? Go peek at GeoIP2::WebService::Client β€” the list lives there.

This attribute is returned by all end points.


πŸ› SUPPORT πŸ›

Found a bug? First of all, relatable. Second of all, bugs may be submitted through:

https://github.com/maxmind/GeoIP2-perl/issues

Go forth and file, bestie. 🫑


πŸ‘‘ AUTHORS πŸ‘‘

The legends who made this happen:

  • Dave Rolsky <drolsky@maxmind.com>
  • Greg Oschwald <goschwald@maxmind.com>
  • Mark Fowler <mfowler@maxmind.com>
  • Olaf Alders <oalders@maxmind.com>

Absolute icons, every single one. 🌟


This software is copyright (c) 2013 - 2019 by MaxMind, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free software slay, periodt. πŸ’…


Okay that's the whole page!! This was GeoIP2::Record::Continent, manual page GeoIP2...ntinent(3pm), brought to you by perl v5.36.0, dated 2022-11-21. Go get those continents, bestie πŸŒπŸ’–βœ¨
πŸ“¦ where this page comes from