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. nonamespace::) 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 areAssociationobjects 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, thenew()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)β theset_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)β theget_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)β theset_slot()method sets the slot$nameto the value$val.- Return value: the new value of the slot, i.e.
$val. - Side effects: none.
- Return value: the new value of the slot, i.e.
$val = $obj->get_slot($name)β theget_slot()method is used to get the values of a number of slots at the same time.- Return value: a single slot value, or
undefif the slot has not been initialized. ghosted, basically π» - Side effects: none.
- Return value: a single slot value, or
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 π
π«Άπ
π¦ where this page comes from
- debian bookworm: libbio-mage-perl 20030502.3-6 Β· MIT
- debian trixie: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu jammy: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu noble: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu resolute: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu stonking: libbio-mage-perl 20030502.3-6 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms