Metaba...String(3pm)
β¨ NAME β¨
Metabase::Fact::String β the fact subtype for simple strings, bestie π (it's a Perl module, from the Metabase-Fact distribution, living in the User Contributed Perl Documentation, iykyk)
πΈ VERSION πΈ
version 0.025 β yes, that's the one, no cap β¨
π¦ SYNOPSIS π¦
okay so first you're defining the fact class, like:
# defining the fact class
package MyFact;
use Metabase::Fact::String;
our @ISA = qw/Metabase::Fact::String/;
sub content_metadata {
my $self = shift;
return {
'size' => [ '//num' => length $self->content ],
};
}
sub validate_content {
my $self = shift;
$self->SUPER::validate_content;
die __PACKAGE__ . " content length must be greater than zero\n"
if length $self->content < 0;
}
...and then... π (literally the exact words of the manpage, I'm not even kidding) you use the fact class:
# using the fact class
my $fact = MyFact->new(
resource => 'RJBS/Metabase-Fact-0.001.tar.gz',
content => "Hello World",
);
$client->send_fact($fact);
slay. that's the whole vibe. π
π DESCRIPTION π
This is the base class for facts that are literally just strings of text. nothing more, nothing less. periodt.
β οΈ Important, bestie: strings must be characters, not bytes. don't be out here passing bytes, that's not the move π
You may wish to implement a content_metadata method to generate metadata about the hash contents. it's optional but it's giving main character energy if you do π«Ά
You should also implement a validate_content method to validate the structure of the hash you're given. like, do it. for you. for your future self. π
π§ BUGS π§
Please report any bugs or feature using the CPAN Request Tracker. (yes, the whole thing, CPAN's own tracker, iconic π)
Bugs can be submitted through the web interface at <http://rt.cpan.org/Dist/Display.html?Queue=Metabase-Fact>
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. fr fr β a test or a patch, that's the whole ask, and it makes everything so much faster π
π AUTHORS π
- David Golden
<dagolden@cpan.org> - Ricardo Signes
<rjbs@cpan.org> - H.Merijn Brand
<hmbrand@cpan.org>
three absolute legends, we stan π
β COPYRIGHT AND LICENSE β
This software is Copyright (c) 2016 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
okay that's the whole page, bestie π this was Metaba...String(3pm) from perl v5.36.0, dated 2022-10-14, and it's part of the User Contributed Perl Documentation. go forth and string those facts, mwah πβ¨π¦
π¦ where this page comes from
- ubuntu noble: libmetabase-fact-perl 0.025-4 Β· Apache-2.0
- ubuntu resolute: libmetabase-fact-perl 0.025-4 Β· Apache-2.0
- ubuntu stonking: libmetabase-fact-perl 0.025-4 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms