KiokuD...ole::ID(3pm)
π KiokuDB::Role::ID π
okay so bestie, welcome to KiokuDB::Role::ID(3pm) β a Perl role straight out of the User Contributed Perl Documentation, and honestly? it's giving "i pick my own destiny" energy. β¨
πΈ NAME πΈ
KiokuDB::Role::ID β a role for objects who choose their own ID. periodt. you don't get to hand them a name, they already know who they are π
π VERSION π
version 0.57 β yes, we're living in the 0.57 era, iconic, no notes π«Ά
π¦ SYNOPSIS π¦
like, here's the vibe in code, bestie:
# typically you set up your own ID role, and map the C<kiokudb_object_id>
# method to your schema's ID
package MySchema::ID;
use Moose::Role;
with qw(KiokuDB::Role::ID);
sub kiokudb_object_id { shift->id };
requires "id";
package MySchema::Foo;
use Moose;
with qw(MySchema::ID);
sub id { ... }
so real talk: usually you make your own ID role, then map the kiokudb_object_id method over to whatever your schema calls an ID. very demure, very mindful, very modular. π§
β¨ DESCRIPTION β¨
This role provides a way for objects to determine their own IDs. main character energy fr fr π
You must implement or alias the kiokudb_object_id method to return a string. that's not optional, that's the whole deal, that's the assignment. π
π REQUIRED METHODS π
kiokudb_object_idβ should return a string to be used as the ID of the object. like, a string string. that's the one job. do it. π
π« AUTHOR π«
Yuval Kogman <nothingmuch@woobling.org> β shoutout to the legend who wrote this π«‘
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, that's the good license, the one that actually lets you do stuff πΈ
okay that's the whole page bestie, go forth and let your objects name themselves π
and a lil sign-off for you: this one's from perl v5.34.0, dated 2022-05-23 π mwah, bye!! π
β¨
π¦ where this page comes from
- debian bookworm: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libkiokudb-perl 0.57-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms