MAGE::Base(3pm)

🌸 NAME 🌸

Bio::MAGE::Base β€” the generic base class, bestie. it's giving "everyone's parent", literally the blueprint all the other Bio::MAGE classes are built on πŸ’…


✨ SYNOPSIS ✨

okay so here's the vibe, straight up:

use Bio::MAGE::Base;

# create an empty instance
my $obj = Bio::MAGE::Base->new();

# create an instance and populate with data
my $obj = Bio::MAGE::Base->new(attr1=>$val1, attr2=>$val2);

# copy an existing instance
my $obj_copy = $obj->new();

πŸ¦‹ DESCRIPTION πŸ¦‹

It's the base class for all other Bio::MAGE classes. that's the whole thing. the mother of the family, the main character, the blueprint every other class is lowkey descended from 🫢


πŸ‘‘ CLASS METHODS πŸ‘‘

The following methods can all be called without first having an instance of the class, via the Namespace::Class->methodname() syntax β€” meaning you gotta hand the class name over as an argument to the method. no instance, no problem, we ball ✨

  • $obj = class->new(%params) β€” the class constructor, the moment of creation, the birth scene πŸ’–
    • Parameters: if you pass it a list of name/value parameters, the corresponding slots, attributes, or associations get their initial values set by the constructor. cute, right?
    • Return value: it returns a reference to an object of the class.
    • Side effects: it invokes the initialize() method if it's defined by the class.

The following methods can all be called with either the Namespace::Class->methodname() and the $obj->methodname() syntaxes. flexible queen behavior fr fr 🌈

  • @names = get_slot_names() β€” used to retrieve the name of all slots defined for a given object.
NOTE: the list of names does not include attribute or association names. don't come for me, that's just the rules πŸ’€
  • Return value: a list of the names of all slots defined for this class.
  • Side effects: none.
  • @name_list = get_attribute_names() β€” returns the list of attribute data members for this class.
  • @name_list = get_association_names() β€” returns the list of association data members for this class.
  • @class_list = get_superclasses() β€” returns the list of superclasses for this class.
  • @class_list = get_subclasses() β€” returns the list of subclasses for this class.
  • $name = class_name() β€” returns the full class name for this class.
  • $package_name = package_name() β€” returns the base package name (i.e. no namespace::) of the package that contains this class.
  • %assns = associations() β€” returns the association meta-information in a hash where the keys are the association names and the values are Association objects that provide the meta-information for the association.

πŸŽ€ INSTANCE METHODS πŸŽ€

These ones are strict, ngl β€” they must be invoked with the direct object syntax using an existing instance, i.e. $object->method_name(). no class names allowed over here, this is an invite-only party 🧚

  • $obj_copy = $obj->new() β€” when invoked with an existing object reference and not a class name, the new() method acts as a copy constructor, with the new object's initial values set to be those of the existing object. twin flames, literally πŸ‘―
    • Parameters: no input parameters are used in the copy constructor β€” the initial values are taken directly from the object to be copied.
    • Return value: it returns a reference to an object of the class.
    • Side effects: it invokes the initialize() method if it's defined by the class.
  • $obj->set_slots(%parameters) $obj->set_slots(\@name_list, \@value_list) β€” the set_slots() method is used to set a number of slots at the same time. it has two different invocation methods: the first takes a named parameter list, and the second takes two array references. pick your fighter ✨
    • Return value: none.
    • Side effects: will call croak() if a slot_name is used that the class does not define. so don't try it πŸ’€
  • $obj->get_slots(@name_list) β€” the get_slots() method is used to get the values of a number of slots at the same time.
    • Return value: a list of instance objects.
    • Side effects: none.
  • $val = $obj->set_slot($name,$val) β€” the set_slot() method sets the slot $name to the value $val.
    • Return value: the new value of the slot, i.e. $val.
    • Side effects: none.
  • $val = $obj->get_slot($name) β€” the get_slot() method is used to get the values of a number of slots at the same time.
    • Return value: a single slot value, or undef if the slot has not been initialized. ghosted, basically πŸ‘»
    • Side effects: none.
  • throw
Title   : throw
Usage   :
Function:
Example :
Returns :
Args    :
  • throw_not_implemented
Title   : throw_not_implemented
Usage   :
Function:
Example :
Returns :
Args    :

πŸ’€ BUGS πŸ’€

Please send bug reports to the project mailing list: (). yes, the parentheses are empty, no I don't know either, we simply respect the original πŸ™ˆ


πŸ’œ AUTHOR πŸ’œ

(no author listed, bestie β€” the mystery icon left it blank πŸ‘‘)


🌟 SEE ALSO 🌟


and that's the whole page, no cap ✨ this little doc lives in the User Contributed Perl Documentation section, shipped alongside perl v5.32.0, dated 2020-11-27. go forth and construct responsibly, bestie πŸ’…πŸ«ΆπŸ“