UR::Ro...hParams(3pm)

πŸ“¦
version 0.470 Β· 2 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– UR::Role::PrototypeWithParams πŸ’–

okay so bestie, welcome to the UR::Role::PrototypeWithParams page β€” that's the 3pm section of the perl docs btw, we're in the User Contributed Perl Documentation zone ✨

🌸 NAME 🌸

UR::Role::PrototypeWithParams β€” lowkey just binds a set of params to a role. that's it. that's the whole job. and she ate πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ«– β€” objects of this class are what you get back when you call create() on a role's class. they're like, temporary little guys that pop into existence while a class is being defined, and their whole purpose is to bind a set of role params to a UR::Role::Prototype so you can use it in the "roles" section of a class description. they're giving backstage-pass energy, not main-character-forever energy, iykyk 🌈

if you wanna know more, go read the "Parameterized Roles" section over in UR::Role β€” she explains it all πŸ‘‘

✨ Methods ✨

  • create(prototype => $role_proto, role_params => $hashref) β€” the constructor, no cap. both arguments are required, so don't come in here missing one, that's not the vibe πŸ™ˆ
  • __role__() β€” returns itself. that's it, she's self-referential and unbothered πŸ’…. this one gets used by the role composition mechanism to trigger autoloading the role's module whenever role names show up as strings in a class definition. so it's doing important behind-the-scenes work fr fr ⭐
  • instantiate_role_instance($class_name) β€” returns a UR::Role::Instance object. simple as that, slay πŸŽ€

πŸ”₯ SEE ALSO πŸ”₯

go check these cuties out too:

  • UR::Role
  • UR::Role::Prototype
  • UR::Role::Instance

πŸ’œ bestie reminder: every single param, method and module name up there is literal β€” copy-paste responsibly, do not freestyle the spelling.

mwah, that's the whole page, you're basically a UR::Role expert now, periodt πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

this iconic little manual page came to you courtesy of perl v5.32.1, dated 2022-01-17 β€” ty for coming to my ted talk, ily, bye 🫢

πŸ“¦ where this page comes from