Net::T...nection(3pm)

πŸ“¦
version 0.16 Β· 2 versions
  • 0.16 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.16 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::Trac::Connection β€” the group chat with your Trac server πŸ’–

Net::Trac::Connection lives in the User Contributed Perl Documentation section of your friendly neighborhood manual, and it's a 3pm page, meaning it's a Perl module. Bestie, this is the page that tells you how to slide into your Trac server's DMs. πŸ¦‹


✨ NAME ✨

Net::Trac::Connection β€” Connection to a remote Trac server. It's giving "the one who talks to Trac so you don't have to." πŸ’…


🌸 DESCRIPTION 🌸

Okay so listen. This class represents a connection to a remote Trac instance. That's it, that's the whole vibe. It is required by all other classes which need to talk to Trac β€” so like, every other class in this little friend group is depending on this one to carry the conversation. No pressure, queen. πŸ‘‘


⭐ SYNOPSIS ⭐

Here's the moment you've been waiting for, the main character entrance:

use Net::Trac::Connection;

my $trac = Net::Trac::Connection->new(
    url      => 'http://trac.example.com',
    user     => 'snoopy',
    password => 'doghouse'
);

Look at that. snoopy and doghouse, iconic behavior honestly. 🐢


πŸŽ€ ACCESSORS πŸŽ€

These are the read-only girlies. Look, don't touch. πŸ’œ

  • url β€” The url of the Trac instance used by this connection. Read-only after initialization, so once it's set, it's set. Periodt. πŸ”’

user

password

Yep. Those two. Just sitting there being accessors, exactly like the original says and not a single syllable more. 😌


πŸ’… ACCESSORS / MUTATORS πŸ’…

These ones you can change. Living their best flexible lives. 🌈

  • logged_in [BOOLEAN] β€” Gets/sets a boolean indicating whether or not the connection is logged in yet. So like, are we in or are we not in? This flag knows. πŸšͺ✨
  • mech [MECH] β€” Gets/sets the Net::Trac::Mechanize (or subclassed) object for this connection to use. Unless you want to replace it with one of your own, the default will suffice. Ngl the default is lowkey doing great, but if you've got a custom mech you're obsessed with, go off. πŸ€–πŸ’–

πŸ”₯ METHODS πŸ”₯

new PARAMHASH

Creates a new Net::Trac::Connection given a paramhash with values for the keys "url", "user", and "password". That's the birth certificate right there. Welcome to the world, little connection. πŸΌπŸ¦‹

ensure_logged_in

Ensures this connection is logged in. Returns true on success, and undef on failure. Also sets the "logged_in" flag, so everyone knows what happened. Fr fr, it's the responsible one. βœ…


πŸ™ˆ PRIVATE METHODS πŸ™ˆ

These are the private ones, okay? Like, the notes app drafts. You can peek, but they're not for you. 🫣

_fetch URL

Fetches the provided relative URL from the Trac server. Returns undef on an error (after warning, because it's not gonna suffer in silence) and the content ("$self-"mech->content>) on success. πŸ’Œ

_warn_on_error URL

Checks the last request for an error condition and warns about them if found. Returns with a TRUE value if errors occurred and a FALSE value otherwise, for nicer conditionals. It's giving considerate. πŸŽ€

_tsv_to_struct PARAMHASH

Takes a paramhash of the keys "data". Given TSV data this method will return a reference to an array. Glow up: tabs in, arrayref out. βœ¨πŸ“


πŸ‘‘ LICENSE πŸ‘‘

Copyright 2008-2009 Best Practical Solutions.

This package is licensed under the same terms as Perl 5.8.8. πŸ’œ


And that's the whole page, bestie! This one came from perl v5.36.0, dated 2022-12-12, under the header Net::T...nection(3pm). Stay logged in, stay slay. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from