Data::HAL::URI(3pm)

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

πŸ’– Data::HAL::URI β€” URI wrapper πŸ’–

okay bestie, listen up, because this one is genuinely precious. Data::HAL::URI is literally just a wrapper for URI objects. that's it. that's the whole vibe. it holds a URI and looks cute doing it. πŸŽ€


✨ VERSION ✨

this doc is describing Data::HAL::URI version 1.001. yes, iconic, we know. πŸ’…


🌸 SYNOPSIS 🌸

the group-chat-approved usage, fr fr:

my $relation = $resource->relation->as_string;

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. it's a wrapper. for URI objects. 🫢

no cap, that's the description. slim, chic, does the job. the way that it just... wraps. obsessed. 😭


πŸ‘‘ INTERFACE πŸ‘‘

🧚 Composition

  • None β€” but URI methods are delegated through the "uri" attribute. so it's giving proxy energy, not inheritance energy. iykyk.

πŸ“ Constructors

✨ "new"

my $u = Data::HAL::URI->new('http://example.com/something');
  • takes a string argument πŸ“
  • returns a Data::HAL::URI object 🎁

that's it. one arg in, one adorable little object out. slay.

πŸ’… Attributes

✨ "uri"

  • type: URI 🌈
  • required ⚠️
  • readonly πŸ”’ β€” it can only be set from the "new" constructor, so don't even try it, bestie
  • this attribute delegates all methods to URI except as_string πŸ‘€

πŸŽ€ Methods

✨ "as_string"

here's the tea, and it's actually kinda clever:

  • if the thing is still equal to the uri β†’ it hands you back the original argument you passed to the constructor 🫢
  • and yes, equality also takes CURIE expansion into account β€” it's not just a dumb string comparison, she's thorough πŸ’…
  • otherwise β†’ it returns the uri as a string πŸ“

and if you want the unaltered behaviour, no worries, that's still available through the "uri" accessor, like:

$resource->relation->uri->as_string

see? two ways to do the thing. main character energy either way. πŸ‘‘

🌈 Exports

None. nothing. zero. zilch. she keeps to herself, respectfully. πŸ™ˆ


πŸ’€ DIAGNOSTICS πŸ’€

None. no warnings, no drama, no cryptic error messages to decode at 2am. bless. 😭


⭐ CONFIGURATION AND ENVIRONMENT ⭐

Requires no configuration files or environment variables. literally nothing to set up. plug and play. the vibe check passes itself. βœ…


quick reminder bestie: "uri" is readonly and can only be set from "new". don't fight it, she's not changing. πŸ’œ

this page ships with perl v5.36.0, dated 2022-08-28 β€” so yes, she's a little vintage but she's still serving looks. stan. πŸŽ€βœ¨

πŸ“¦ where this page comes from