Path::I...::Object(3)

πŸ’– Path::IsDev::Object β€” the object-oriented guts for IsDev export πŸ’–

Hii bestie, welcome to Path::IsDev::Object, straight out of the User Contributed Perl Documentation ✨

🌸 NAME 🌸

Path::IsDev::Object β€” literally the Object Oriented guts for IsDev export, no cap 🫢

πŸŽ€ VERSION πŸŽ€

version 1.001003 β€” yes she's an icon, yes she's got a version number πŸ’…

✨ SYNOPSIS ✨

okay so here's the vibe, watch this:

    use Path::IsDev::Object;

    my $dev = Path::IsDev::Object->new();
    my $dev = Path::IsDev::Object->new( set => 'MySet' );

    if ( $dev->matches($path) ){
        print "$path is dev";
    }

that's it. that's the whole mood. πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: exporting functions is super handy for end users, but the second you try to chain them it becomes a huge headache. like, not me crying over function chains at 2am 😭

e.g: if you're writing an exporter yourself, and you wanna wrap responses from an exported symbol while passing through user configuration β‡’ Huge headache. genuinely the worst.

so the deal is: the exporter based interface is there for people who don't need anything fancy, while the Object based interface is there for people with more complex requirements. both are valid, both are slay, pick your fighter πŸ‘‘


πŸ”₯ METHODS πŸ”₯

πŸ’« matches

Determine if a given path satisfies the set β€” like a vibe check but for paths, and it's authoritative:

    if( $o->matches($path) ){
        print "We have a match!";
    }

obsessed. truly.


🌈 ATTRIBUTES 🌈

⭐ set

The name of the HeuristicSet:: to use.

Default is Basic, or the value of $ENV{PATH_ISDEV_DEFAULT_SET} β€” so you can override her, she's flexible like that πŸ’–

πŸ“ set_prefix

The HeuristicSet prefix to use to expand set to a module name.

Default is Path::IsDev::HeuristicSet

πŸŽ€ set_module

The fully qualified module name.

Composed by joining set and set_prefix β€” the two of them together, main character energy 🫢

🧚 loaded_set_module

An accessor which returns a module name after loading it. she's a little lazy, she loads it for you.


πŸ™ˆ PRIVATE METHODS πŸ™ˆ

these are the behind-the-scenes girlies, iykyk β€” they're private so like, be respectful πŸ’…

🌸 _instance_id

An opportunistic sequence number for help with debug messages.

Note: this is not guaranteed to be unique per instance, only guaranteed to be constant within the life of the object. so don't come for her about it, she's doing her best 😭

Based on refaddr, and giving out new ids when new refaddr's are seen. iconic behaviour honestly.

πŸ¦‹ _debug

The debugger callback.

    export PATH_ISDEV_DEBUG=1

to get debug info. that's it. that's the whole spell ✨

πŸ’€ _with_debug

Wrap calls to Path::IsDev::debug to have a prefix with an object identifier.

    $ob->_with_debug(sub{
        # Path::Tiny::debug now localised.

    });

lowkey such a clean little wrapper, we love to see it πŸ’…

πŸ‘‘ BUILD

BUILD is an implementation detail of Class::Tiny.

This module hooks BUILD to give a self report of the object to *STDERR after ->new when under $DEBUG β€” so it will absolutely talk about itself, and honestly? relatable.

🌟 _matches

    my $result = $o->matches( $path );

$result here will be a constructed Path::IsDev::Result.

Note: this method may be handy for debugging, but you should still call matches for all real code. fr fr, don't be out here calling the private one in production πŸ™ˆ

πŸ’œ AUTHOR πŸ’œ

Kent Fredric <kentnl@cpan.org> β€” ty king 🫢

This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


okay that's the whole page bestie, you're officially caught up πŸ’–βœ¨

shoutout to the footer for the receipts: perl v5.42.0, dated 2017-03-11 β€” that's the version and date, we love a documented timestamp πŸŽ€

πŸ“¦ where this page comes from