.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Path::IsDev::Object 3" .TH Path::IsDev::Object 3 2023-07-26 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Path::IsDev::Object \- Object Oriented guts for IsDev export .SH VERSION .IX Header "VERSION" version 1.001003 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Path::IsDev::Object; \& \& my $dev = Path::IsDev::Object\->new(); \& my $dev = Path::IsDev::Object\->new( set => \*(AqMySet\*(Aq ); \& \& if ( $dev\->matches($path) ){ \& print "$path is dev"; \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Exporting functions is handy for end users, but quickly becomes a huge headache when you're trying to chain them. .PP e.g: If you're writing an exporter yourself, and you want to wrap responses from an exported symbol, while passing through user configuration => Huge headache. .PP So 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. .SH METHODS .IX Header "METHODS" .ie n .SS """matches""" .el .SS \f(CWmatches\fP .IX Subsection "matches" Determine if a given path satisfies the \f(CW\*(C`set\*(C'\fR .PP .Vb 3 \& if( $o\->matches($path) ){ \& print "We have a match!"; \& } .Ve .SH ATTRIBUTES .IX Header "ATTRIBUTES" .ie n .SS """set""" .el .SS \f(CWset\fP .IX Subsection "set" The name of the \f(CW\*(C`HeuristicSet::\*(C'\fR to use. .PP Default is \f(CW\*(C`Basic\*(C'\fR, or the value of \f(CW$ENV{PATH_ISDEV_DEFAULT_SET}\fR .ie n .SS """set_prefix""" .el .SS \f(CWset_prefix\fP .IX Subsection "set_prefix" The \f(CW\*(C`HeuristicSet\*(C'\fR prefix to use to expand \f(CW\*(C`set\*(C'\fR to a module name. .PP Default is \f(CW\*(C`Path::IsDev::HeuristicSet\*(C'\fR .ie n .SS """set_module""" .el .SS \f(CWset_module\fP .IX Subsection "set_module" The fully qualified module name. .PP Composed by joining \f(CW\*(C`set\*(C'\fR and \f(CW\*(C`set_prefix\*(C'\fR .ie n .SS """loaded_set_module""" .el .SS \f(CWloaded_set_module\fP .IX Subsection "loaded_set_module" An accessor which returns a module name after loading it. .SH "PRIVATE METHODS" .IX Header "PRIVATE METHODS" .ie n .SS """_instance_id""" .el .SS \f(CW_instance_id\fP .IX Subsection "_instance_id" An opportunistic sequence number for help with debug messages. .PP Note: This is not guaranteed to be unique per instance, only guaranteed to be constant within the life of the object. .PP Based on \f(CW\*(C`refaddr\*(C'\fR, and giving out new ids when new \f(CW\*(C`refaddr\*(C'\fR's are seen. .ie n .SS """_debug""" .el .SS \f(CW_debug\fP .IX Subsection "_debug" The debugger callback. .PP .Vb 1 \& export PATH_ISDEV_DEBUG=1 .Ve .PP to get debug info. .ie n .SS """_with_debug""" .el .SS \f(CW_with_debug\fP .IX Subsection "_with_debug" Wrap calls to Path::IsDev::debug to have a prefix with an object identifier. .PP .Vb 2 \& $ob\->_with_debug(sub{ \& # Path::Tiny::debug now localised. \& \& }); .Ve .ie n .SS """BUILD""" .el .SS \f(CWBUILD\fP .IX Subsection "BUILD" \&\f(CW\*(C`BUILD\*(C'\fR is an implementation detail of \f(CW\*(C`Class::Tiny\*(C'\fR. .PP This module hooks \f(CW\*(C`BUILD\*(C'\fR to give a self report of the object to \f(CW*STDERR\fR after \f(CW\*(C`\->new\*(C'\fR when under \f(CW$DEBUG\fR .ie n .SS """_matches""" .el .SS \f(CW_matches\fP .IX Subsection "_matches" .Vb 1 \& my $result = $o\->matches( $path ); .Ve .PP \&\f(CW$result\fR here will be a constructed \f(CW\*(C`Path::IsDev::Result\*(C'\fR. .PP Note this method may be handy for debugging, but you should still call \f(CW\*(C`matches\*(C'\fR for all real code. .SH AUTHOR .IX Header "AUTHOR" Kent Fredric .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Kent Fredric . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.