SPVM::B...Resource(3)

πŸ“¦ version 0.990125, in alpine 3.24

✨ SPVM::B...Resource(3) ✨

okay so bestie, this page lives in the User Contributed Perl Documentation section of the manual (yes, that's the manual name, don't come for me 🫢), and it's literally all about SPVM::Builder::Resource β€” a whole class for manipulating resources. iykyk πŸ’…


🌸 NAME 🌸

SPVM::Builder::Resource β€” Resource. that's it, that's the name, short and iconic πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

the SPVM::Builder::Resource class has methods to manipulate resources. no cap, that's the whole vibe check. ✨

πŸŽ€ USAGE πŸŽ€

here's how you actually get one of these bad boys going:

my $resource = SPVM::Builder::Resource->new(
  class_name => 'Resource::Zlib',
);

see? not scary at all. main character energy fr fr πŸ’–

🧚 DETAILS 🧚

for the full tea on creating and using resources, go peek at SPVM::Document::Resource. it's giving "read the other page first" but like, lovingly πŸ’œ

⭐ FIELDS ⭐

class_name

my $class_name = $resource->class_name;
$resource->class_name($class_name);

gets and sets the "class_name" field β€” which is, shocking twist, the class name of this resource. obsessed with the naming consistency honestly πŸŽ€

config

my $config = $resource->config;
$resource->config($config);

gets and sets the "config" field, which is an SPVM::Builder::Config object. a whole object, living inside your resource, slay 🌈

πŸ‘‘ CLASS METHODS πŸ‘‘

new

my $resource = SPVM::Builder::Resource->new(%fields);

creates a brand new SPVM::Builder::Resource object using "Fields". fresh out the box, no notes πŸ’…

Field Default Values:

  • "class_name" β€” undef
  • "config" β€” undef

like, both start out as undef because you get to decide their destiny. character development arc pending 🌱

πŸ’– INSTANCE METHODS πŸ’–

to_string

my $string = $resource->to_string;

returns the "class_name" field. that's it. simple, clean, ate πŸ”₯

πŸ¦‹ OPERATORS πŸ¦‹

overloads the following operators. fancy, i know ✨

bool

my $bool = !!$resource;

always true. literally always. your resource is that confident πŸ’€πŸ‘‘

stringify

my $class_name = "$resource";

the alias for the "to_string" method. so when you stringify it, you get the class name β€” same energy, different syntax πŸŽ€


Copyright (c) 2023 Yuki Kimoto

MIT License


and that's the whole page bestie, every single detail preserved, zero cap πŸ™ˆπŸ’œ

okay and the cute lil sign-off: this gorgeous thing is from perl v5.42.2, dated 2026-02-03 β€” so when you're citing it, that's your source and your date, periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from