RoPkg:...Command(3pm)

πŸ“¦ version 0.8.4, in ubuntu jammy

πŸ’– RoPkg::Simba::Command β€” the perl manual page, but make it make sense πŸ’–

okay bestie, you found the RoPkg:...Command(3pm) page in the perl docs, and honestly? it's giving niche but powerful. let's get into it 🫢


✨ NAME ✨

RoPkg::Simba::Command

like, that's the whole name. that's the class. periodt. πŸ’…


🌸 VERSION 🌸

0.1.2

she's a lil baby version but she's doing her best πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

RoPkg::Simba::Command is the class that simba uses to mess with a command. think of it as the little handler that knows how to poke at one single command record.

and plot twist: it also comes with the basic sql methods, which it inherits from RoPkg::DBObject. so it's not doing all the heavy lifting itself, it's standing on the shoulders of its parent class. iconic behavior honestly πŸ‘‘


🌈 SYNOPSIS 🌈

here's how you actually use it, no cap:

!#/usr/bin/perl

use RoPkg::DB;
use RoPkg::Simba::Command;

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

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

main();

so you spin up a RoPkg::DB, register a connection with Add(), make yourself a RoPkg::Simba::Command with db and db_method, set the id, and then Load() it. that's the whole ritual bestie, go off ✨


πŸ’œ SUBROUTINES/METHODS πŸ’œ

heads up, important rules time: every single method except new raises an OutsideClass exception if you call it outside a class instance. so like, don't just be calling these into the void, okay? 😭

also some methods raise their own special little exceptions. when that's the case, we say it in that method's section so you know exactly what you're getting into. no surprises here πŸ’–

πŸ’… new()

the class constructor. right now it literally just calls RoPkg::DBObject->new(). that's it. that's the whole thing.

if you wanna know what params you can pass to new(), go read the RoPkg::DBObject manual page, because this one's just forwarding the vibe πŸŽ€

πŸ’… table()

returns the name of the commands database table. simple. clean. slay.

and now, the following methods are the get/set methods for all the fields of a mirror:

  • id
  • Path
  • Args

(yes, it says mirror, we're reporting what the page says, we don't make the rules 🫢)

πŸ’… 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 πŸ’€

πŸ’… Delete()

deletes the current command from the database.

before you call this, you gotta set the id of the command. if you don't set the id, a Param::Missing exception is raised. no id, no delete, that's the law βš–οΈ
  • on database operation success, 0 is returned βœ…
  • on database error, a DBI exception is raised πŸ’€

πŸ’… Update()

updates the current command object with the database.

before you call this, you gotta set the id of the command. if you don't set the id, a Param::Missing exception is raised.
  • on database operation success, 0 is returned βœ…
  • on database error, a DBI exception is raised πŸ’€

πŸ’… Load()

loads the command from the database into the current object.

before you call this you should have set id. if id is not set, then Param::Missing is raised. πŸ”₯
  • on database operation success, 0 is returned βœ…
  • on database error, a DBI exception is raised πŸ’€

πŸŽ€ DIAGNOSTICS πŸŽ€

this module comes with his own tests (that's the page's wording, we love him for it). to run them: unpack the source, and use the make test commmand. (yes, "commmand". we're keeping the typo. it's part of the lore now 😌)


🧚 CONFIGURATION AND ENVIRONMENT 🧚

this module doesn't use configuration files and environment variables. nothing to configure. she just is. πŸ’…


⭐ DEPENDENCIES ⭐

  • RoPkg::DBObject
  • RoPkg::Exceptions

πŸ™ˆ INCOMPATIBILITIES πŸ™ˆ

None known to the author. (so, like, keep it cute and hopefully it stays that way 🫢)


πŸ’€ BUGS AND LIMITATIONS πŸ’€

None known to the author. (the author said it, not us, don't come for us 😭)


πŸ”₯ PERL CRITIC πŸ”₯

the code is perl critic level 2 compliant (with one exception). one single exception. we don't know which one. she's mysterious like that ✨


πŸ¦‹ SEE ALSO πŸ¦‹

  • RoPkg::Simba::Commands
  • RoPkg::Exceptions
  • RoPkg::Object

go read those too bestie, they're the extended universe 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Subredu Manuel <diablo@iasi.roedu.net>


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.


and that's the page!! this was documented by perl v5.28.1 on 2018-12-09, and honestly it ate. bye bestie, go load some commands πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from