Metaba...String(3pm)

πŸ“¦
version 0.025 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 🌟


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