MakeMe...e::Ref(3pm)

πŸ“¦
version 1.01 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ¦‹ NAME πŸ¦‹

Class::MakeMethods::Template::Ref β€” Universal copy and compare methods.

Okay bestie, this page is MakeMe...e::Ref(3pm) from User Contributed Perl Documentation, and it is literally here to give you copy and compare methods. πŸ’…

✨ SYNOPSIS ✨

No cap, the whole setup is right here:

         package MyObject;
         use Class::MakeMethods::Template::Ref (
           'Hash:new'      => [ 'new' ],
           clone           => [ 'clone' ]
         );

         package main;

         my $obj = MyObject->new( foo => ["Foozle", "Bozzle"] );
         my $clone = $obj->clone();
         print $obj->{'foo'}[1];

πŸ’œ DESCRIPTION πŸ’œ

The following types of methods are provided via the Class::MakeMethods interface:

🫢 clone

Produces a deep copy of an instance of almost any underlying datatype. It’s giving β€œsame energy, new object” ✨

Parameters:

  • init_method β€” if defined, this method is called on the new object with any arguments passed in. πŸŽ€

🌸 prototype

Creates new instances by making a deep copy of a static prototypical instance. Prototype says β€œhere’s the blueprint,” and you get a fresh copy. πŸ’…

Parameters:

  • init_method β€” if defined, this method is called on the new object with any arguments passed in. 🫢

πŸ”₯ compare

Compare one object to another. Main character energy: β€œwho even are you?” 😭

πŸŽ€ Templates

  • default β€” Three-way (sorting-style) comparison.
  • equals β€” Are these two objects equivalent?
  • identity β€” Are these two references to the exact same object?

🌈 SEE ALSO 🌈

  • See Class::MakeMethods for general information about this distribution. πŸ‘‘
  • See Class::MakeMethods::Template for more about this family of subclasses. 🧚
  • See Class::MakeMethods::Utility::Ref for the clone and compare functions used above. πŸ’–

Okay final sign-off, bestie: this page comes from User Contributed Perl Documentation, source/version perl v5.36.0, dated 2022-10-13, and the page is MakeMe...e::Ref(3pm) β€” slay, bye! πŸ’…βœ¨

πŸ“¦ where this page comes from