RoPkg:...Exclude(3pm)

๐Ÿ“ฆ version 0.8.4, in ubuntu jammy

๐Ÿ’– NAME ๐Ÿ’–

RoPkg::Simba::Exclude โ€” yes bestie, this is the page for RoPkg:...Exclude(3pm), living its best life in the User Contributed Perl Documentation section, and we are going to read it together like the iconic little class it is. ๐Ÿ’…


โœจ VERSION โœจ

0.1.2 โ€” she's a lil vintage but she still slays, no cap. ๐ŸŽ€


๐ŸŒธ DESCRIPTION ๐ŸŒธ

RoPkg::Simba::Exclude is the class that simba uses to mess with an exclude list. That's literally her whole job and she does it flawlessly. โœจ

She comes with all the basic sql methods already loaded up โ€” inherited straight from RoPkg::DBObject, so you don't gotta write them yourself. Main character inheritance energy, fr fr. ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

Okay so here's how you actually use her, copy-paste this and you're golden:

!#/usr/bin/perl

use RoPkg::DB;
use RoPkg::Simba::Exclude;

sub main {
  my $dbp = new RoPkg::DB();
  $dbp->Add('dbi:mysql:database=mysql;host=localhost',
            'root',
            '',
            'local');

  my $c = new RoPkg::Simba::Exclude(db => $dbp, db_method => 'db_local');
  $c->id(1);
  $c->Load();
}

main();

Look at that. Gorgeous. No notes. ๐ŸŒˆ


๐Ÿงš SUBROUTINES/METHODS ๐Ÿงš

Heads up bestie, this is important: all methods besides new will raise an OutsideClass exception if you try to call them outside of a class instance. Like, she does NOT do random strangers. ๐Ÿ™…โ€โ™€๏ธ

Also, some methods may raise diferent exceptions depending on the vibe. So please, please, please read the section where the method you care about is described to find out more info about those exceptions. It's giving "read the room" but make it documentation. ๐Ÿ’€

๐ŸŽ€ new()

The class constructor, the origin story, the birth of a star. ๐ŸŒŸ At this moment in time, she just calls RoPkg::DBObject->new(). That's it, that's the whole thing.

If you want the tea on what parameters new() takes, go read the RoPkg::DBObject manual page, bestie. ๐Ÿ‘‘

๐ŸŽ€ table()

Returns the name of the exclude lists database table. Just the name. Simple queen behaviour. ๐Ÿ’…

๐ŸŽ€ ExList()

Get/set the excluded items. ๐Ÿ“

When you pick the set behaviour, you must pass the exclude list into the method. And lowkey important: the exclude list has to be set before you add the new exclude list to the database. Order matters, don't skip steps. โญ

๐ŸŽ€ AddItems(@new_items)

Adds @new_items to the list of excluded items, and returns the new number of excluded items. So you always know how many lil guys are on the list now. ๐Ÿงฎโœจ

๐ŸŽ€ GetItems()

Returns the list of excluded items. ๐ŸŽ

And in scalar context? She returns the number of excluded items instead. Context-sensitive icon. ๐Ÿ‘‘

The following methods are get/set methods for all fields of a mirror.
  • id
  • MirrorID
  • CommandID

๐ŸŽ€ Add()

Adds the mirror to the database. ๐Ÿ—„๏ธโœจ

This method is a wrapper for RoPkg::DBObject::SQL_Insert.

On success, 0 is returned. On error, a DBI exception is raised. No cap.

๐ŸŽ€ Delete()

Deletes the current exclude list from the database. ๐Ÿ’€๐Ÿ—‘๏ธ

Before you call this one, you should set the id of the exclude list. If you don't set the id, a Param::Missing exception gets raised. She said "where's the id, bestie?" ๐Ÿ˜ญ

On database operation success, 0 is returned. On database error, a DBI exception is raised.

๐ŸŽ€ Update()

Updates the current exclude list object with the database. ๐Ÿ”„๐Ÿ’–

Before calling this method, you should set the id of the exclude list. If you don't set the id, a Param::Missing exception is raised. Same energy as Delete(), she is consistent. ๐Ÿ’…

On database operation success, 0 is returned. On database error, a DBI exception is raised.

๐ŸŽ€ Load()

Loads the exclude list from the database, into the current object. ๐Ÿ“ฅ๐Ÿฆ‹

Before calling this method you should have set id, or MirrorID and CommandID. If none of those are found, then Param::Missing is raised. Give her something to work with, please. ๐Ÿ™ˆ

On database operation success, 0 is returned. On database error, a DBI exception is raised.


๐Ÿ”ฅ DIAGNOSTICS ๐Ÿ”ฅ

Unpack the source, and use the make test command. That's the whole diagnostic ritual, go off. โญ


๐ŸŒˆ CONFIGURATION AND ENVIRONMENT ๐ŸŒˆ

This module does not use any configuration files or environment variables. Zero. None. She's low maintenance like that. ๐Ÿงš


๐Ÿ’œ DEPENDENCIES ๐Ÿ’œ

  • RoPkg::DBObject
  • RoPkg::Exceptions

๐Ÿšซ INCOMPATIBILITIES ๐Ÿšซ

None known to the author. Clean slate, no drama. โœจ


๐Ÿ™ˆ BUGS AND LIMITATIONS ๐Ÿ™ˆ

None known to the author. (Famous last words, but we're choosing to believe. ๐Ÿซถ)


๐Ÿ‘‘ PERL CRITIC ๐Ÿ‘‘

This module is perl critic level 2 compliant โ€” with 1 exception. One single exception. We do not discuss it. ๐Ÿ’…


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

  • RoPkg::Simba::Excludes
  • RoPkg::Exceptions
  • RoPkg::Object

๐Ÿ’– AUTHOR ๐Ÿ’–

Subredu Manuel <diablo@iasi.roedu.net> โ€” legend, icon, and the moment. ๐Ÿ‘‘


Copyright (C) 2005 Subredu Manuel. All Rights Reserved. ๐Ÿ“œ

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license โ€” go read it if you want the fine print, bestie. ๐Ÿ’–


Okay that's the whole page, and if you made it all the way down here: slay. This was perl v5.28.1, dated 2018-12-09, and yes, RoPkg:...Exclude(3pm) is still that girl. Bye bestie, go exclude some packages responsibly. ๐Ÿฆ‹โœจ๐Ÿ’…

๐Ÿ“ฆ where this page comes from