MAGE::...otocol(3pm)
β¨ Bio::MAGE::Protocol::Protocol β¨
okay bestie, sit down, hydrate π this is the manual page for Bio::MAGE::Protocol::Protocol β you'll also see it filed under the name MAGE::...otocol(3pm) in the User Contributed Perl Documentation corner of the universe. it's giving class-for-the-MAGE-OM-API energy and honestly? we're obsessed.
πΈ NAME πΈ
Bio::MAGE::Protocol::Protocol β a whole entire class for the MAGE-OM API. that's the name, that's the vibe, periodt.
π SYNOPSIS π
use Bio::MAGE::Protocol::Protocol
# creating an empty instance
my $protocol = Bio::MAGE::Protocol::Protocol->new();
# creating an instance with existing data
my $protocol = Bio::MAGE::Protocol::Protocol->new(
URI=>$uri_val,
name=>$name_val,
identifier=>$identifier_val,
text=>$text_val,
title=>$title_val,
parameterTypes=>\@parameter_list,
auditTrail=>\@audit_list,
propertySets=>\@namevaluetype_list,
hardwares=>\@hardware_list,
descriptions=>\@description_list,
softwares=>\@software_list,
security=>$security_ref,
type=>$ontologyentry_ref,
);
# 'URI' attribute
my $URI_val = $protocol->URI(); # getter
$protocol->URI($value); # setter
# 'name' attribute
my $name_val = $protocol->name(); # getter
$protocol->name($value); # setter
# 'identifier' attribute
my $identifier_val = $protocol->identifier(); # getter
$protocol->identifier($value); # setter
# 'text' attribute
my $text_val = $protocol->text(); # getter
$protocol->text($value); # setter
# 'title' attribute
my $title_val = $protocol->title(); # getter
$protocol->title($value); # setter
# 'parameterTypes' association
my $parameter_array_ref = $protocol->parameterTypes(); # getter
$protocol->parameterTypes(\@parameter_list); # setter
# 'auditTrail' association
my $audit_array_ref = $protocol->auditTrail(); # getter
$protocol->auditTrail(\@audit_list); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $protocol->propertySets(); # getter
$protocol->propertySets(\@namevaluetype_list); # setter
# 'hardwares' association
my $hardware_array_ref = $protocol->hardwares(); # getter
$protocol->hardwares(\@hardware_list); # setter
# 'descriptions' association
my $description_array_ref = $protocol->descriptions(); # getter
$protocol->descriptions(\@description_list); # setter
# 'softwares' association
my $software_array_ref = $protocol->softwares(); # getter
$protocol->softwares(\@software_list); # setter
# 'security' association
my $security_ref = $protocol->security(); # getter
$protocol->security($security_ref); # setter
# 'type' association
my $ontologyentry_ref = $protocol->type(); # getter
$protocol->type($ontologyentry_ref); # setter
like. look at that. getter, setter, getter, setter β a little routine, a little choreography, we love a consistent queen π
π¦ DESCRIPTION π¦
straight up lifted from the MAGE-OM documentation for the "Protocol" class, no cap:
A Protocol is a parameterizable description of a method. ProtocolApplication is used to specify the ParameterValues of it's Protocol's Parameters.
(read that twice if you need to, it's dense but it's the whole point of this class π«Ά)
π INHERITANCE π
Bio::MAGE::Protocol::Protocol has the following superclasses:
Bio::MAGE::Protocol::Parameterizable
so yeah, it's a <purple>Parameterizable</purple> at heart. it got those genes. iconic behavior.
π CLASS METHODS π
these ones are special bestie β you can call all of them without ever making an instance first, using the Bio::MAGE::Protocol::Protocol->methodname() syntax. no object required, we're going straight to the class. main character energy fr fr.
new()
new(%args)
the object constructor new() accepts the following optional named-value style arguments:
URIβ sets the value of the"URI"attribute (this attribute was inherited from class"Bio::MAGE::Protocol::Parameterizable").nameβ sets the value of the"name"attribute (this attribute was inherited from class"Bio::MAGE::Identifiable").identifierβ sets the value of the"identifier"attribute (this attribute was inherited from class"Bio::MAGE::Identifiable").textβ sets the value of the"text"attribute.titleβ sets the value of the"title"attribute.parameterTypesβ sets the value of the"parameterTypes"association (this association was inherited from class"Bio::MAGE::Protocol::Parameterizable"). the value must be of type: array of"Bio::MAGE::Protocol::Parameter".auditTrailβ sets the value of the"auditTrail"association (this association was inherited from class"Bio::MAGE::Describable"). the value must be of type: array of"Bio::MAGE::AuditAndSecurity::Audit".propertySetsβ sets the value of the"propertySets"association (this association was inherited from class"Bio::MAGE::Extendable"). the value must be of type: array of"Bio::MAGE::NameValueType".hardwaresβ sets the value of the"hardwares"association. the value must be of type: array of"Bio::MAGE::Protocol::Hardware".softwaresβ sets the value of the"softwares"association. the value must be of type: array of"Bio::MAGE::Protocol::Software".descriptionsβ sets the value of the"descriptions"association (this association was inherited from class"Bio::MAGE::Describable"). the value must be of type: array of"Bio::MAGE::Description::Description".securityβ sets the value of the"security"association (this association was inherited from class"Bio::MAGE::Describable"). the value must be of type: instance of"Bio::MAGE::AuditAndSecurity::Security".typeβ sets the value of the"type"association. the value must be of type: instance of"Bio::MAGE::Description::OntologyEntry".
ngl the order these show up in the arg list is not the same order as the SYNOPSIS constructor. not me noticing that π anyway, both are correct, just sayin'.
$obj = class->new(%parameters)
the "new()" method is the class constructor. the blueprint-maker. the origin story.
- Parameters: if you hand it a list of name/value parameters, the corresponding slots, attributes, or associations will get their initial values set by the constructor.
- Return value: it returns a reference to an object of the class. a whole baby object π₯Ή
- Side effects: it invokes the
"initialize()"method if it's defined by the class.
@names = class->get_slot_names()
the "get_slot_names()" method is how you retrieve the name of all slots defined in a given class.
NOTE: the list of names does not include attribute or association names. just slots. don't @ me.
- 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. that's it, that's the whole job β¨
@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. the family tree, upward edition π
@class_list = get_subclasses()
returns the list of subclasses for this class. the family tree, downward edition π¦
$name = class_name()
returns the full class name for this class. full government name, no nicknames.
$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 π«Ά
now we're in object territory. you need an actual $protocol for these. let's go.
$obj_copy = $obj->new()
when you invoke it on an existing object reference instead of a class name, the "new()" method acts as a copy constructor β the new object's initial values get set to be those of the existing object. a little clone situation. twin where have you been π
- 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 for setting a bunch of slots at the same time. it has two different invocation methods β the first one takes a named parameter list, and the second one 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 like. don't make up slot names bestie, it will yell at you.
@obj_list = $obj->get_slots(@name_list)
the "get_slots()" method is for getting the values of a bunch 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
undefif the slot has not been initialized. - Side effects: none.
π ATTRIBUTES π
attributes are simple data types that belong to a single instance of a class. in the Perl implementation of the MAGE-OM classes, the interface to attributes is implemented using separate setter and getter methods for each attribute. two methods per attribute, because we believe in balance π§
"Bio::MAGE::Protocol::Protocol" has the following attribute accessor methods:
URI
Methods for the "URI" attribute.
from the MAGE-OM documentation:
Where an instantiated Parameterizable is located.
$val = $protocol->setURI($val)
the restricted setter method for the "URI" attribute.
- Input parameters: the value to which the
"URI"attribute will be set. - Return value: the current value of the
"URI"attribute. - Side effects: none.
- Exceptions: will call
"croak()"if no input parameters are specified, or if too many input parameters are specified. zero args or too many args, both get a croak. no in-between π«
$val = $protocol->getURI()
the restricted getter method for the "URI" attribute.
- Input parameters: none.
- Return value: the current value of the
"URI"attribute. - Side effects: none.
- Exceptions: will call
"croak()"if any input parameters are specified.
name
Methods for the "name" attribute.
from the MAGE-OM documentation:
The potentially ambiguous common identifier.
$val = $protocol->setName($val)
the restricted setter method for the "name" attribute.
- Input parameters: the value to which the
"name"attribute will be set. - Return value: the current value of the
"name"attribute. - Side effects: none.
- Exceptions: will call
"croak()"if no input parameters are specified, or if too many input parameters are specified.
$val = $protocol->getName()
the restricted getter method for the "name" attribute.
- Input parameters: none.
okay we're gonna pause it right here bestie, because this page is LONG and there's more coming π don't go anywhere β
- Return value: the current value of the
nameattribute- Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
identifier π
Methods for the identifier attribute.
From the MAGE-OM documentation:
An identifier is an unambiguous string that is unique within the scope (i.e. a document, a set of related documents, or a repository) of its use.
$val = $protocol->setIdentifier($val)β the restricted setter for theidentifierattribute.- Input parameters: the value to which the
identifierattribute will be set - Return value: the current value of the
identifierattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
- Input parameters: the value to which the
$val = $protocol->getIdentifier()β the restricted getter for theidentifierattribute.- Input parameters: none
- Return value: the current value of the
identifierattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
text π¦
Methods for the text attribute.
From the MAGE-OM documentation:
The text description of the Protocol.
$val = $protocol->setText($val)β the restricted setter for thetextattribute.- Input parameters: the value to which the
textattribute will be set - Return value: the current value of the
textattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
- Input parameters: the value to which the
$val = $protocol->getText()β the restricted getter for thetextattribute.- Input parameters: none
- Return value: the current value of the
textattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
title π
Methods for the title attribute.
From the MAGE-OM documentation:
The title of the Protocol
$val = $protocol->setTitle($val)β the restricted setter for thetitleattribute.- Input parameters: the value to which the
titleattribute will be set - Return value: the current value of the
titleattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
- Input parameters: the value to which the
$val = $protocol->getTitle()β the restricted getter for thetitleattribute.- Input parameters: none
- Return value: the current value of the
titleattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
β¨ ASSOCIATIONS β¨ π
ok bestie, associations are just references to other classes β like your fave mutuals but in object form π . And in MAGE-OM they come with a cardinality, which decides the minimum and maximum number of instances of the other class that can be part of the association:
- There must be exactly one item in the association, i.e. this is a mandatory data field.
- 0..1
There may be one item in the association, i.e. this is an optional data field.
- 1..N
There must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.
- 0..N
There may be one or more items in the association, i.e. this is an optional data field, with list cardinality.
Bio::MAGE::Protocol::Protocol has the following association accessor methods: π
parameterTypes π
Methods for the parameterTypes association.
From the MAGE-OM documentation:
The description of the parameters for the Parameterizable class instance.
$array_ref = $protocol->setParameterTypes($array_ref)β the restricted setter for theparameterTypesassociation.- Input parameters: the value to which the
parameterTypesassociation will be set : a reference to an array of objects of typeBio::MAGE::Protocol::Parameter - Return value: the current value of the
parameterTypesassociation : a reference to an array of objects of typeBio::MAGE::Protocol::Parameter - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array classBio::MAGE::Protocol::Parameterinstances
- Input parameters: the value to which the
$array_ref = $protocol->getParameterTypes()β the restricted getter for theparameterTypesassociation.- Input parameters: none
- Return value: the current value of the
parameterTypesassociation : a reference to an array of objects of typeBio::MAGE::Protocol::Parameter - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $protocol->addParameterTypes(@vals)β because theparameterTypesassociation has list cardinality, it may store more than one value. This method adds the current list of objects in theparameterTypesassociation. π- Input parameters: the list of values
@valsto add to theparameterTypesassociation. NOTE: submitting a single value is permitted. - Return value: the number of items stored in the slot after adding
@vals - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::Protocol::Parameter
- Input parameters: the list of values
auditTrail π΅οΈββοΈ
Methods for the auditTrail association.
From the MAGE-OM documentation:
A list of Audit instances that track changes to the instance of Describable.
$array_ref = $protocol->setAuditTrail($array_ref)β the restricted setter for theauditTrailassociation.- Input parameters: the value to which the
auditTrailassociation will be set : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - Return value: the current value of the
auditTrailassociation : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array classBio::MAGE::AuditAndSecurity::Auditinstances
- Input parameters: the value to which the
$array_ref = $protocol->getAuditTrail()β the restricted getter for theauditTrailassociation.- Input parameters: none
- Return value: the current value of the
auditTrailassociation : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $protocol->addAuditTrail(@vals)β because theauditTrailassociation has list cardinality, it may store more than one value. This method adds the current list of objects in theauditTrailassociation. β¨- Input parameters: the list of values
@valsto add to theauditTrailassociation. NOTE: submitting a single value is permitted. - Return value: the number of items stored in the slot after adding
@vals - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::AuditAndSecurity::Audit
- Input parameters: the list of values
propertySets πΈ
Methods for the propertySets association.
From the MAGE-OM documentation:
Allows specification of name/value pairs. Meant to primarily help in-house, pipeline processing of instances by providing a place for values that aren't part of the specification proper.
$array_ref = $protocol->setPropertySets($array_ref)β the restricted setter for thepropertySetsassociation.- Input parameters: the value to which the
propertySetsassociation will be set : a reference to an array of objects of typeBio::MAGE::NameValueType - Return value: the current value of the
propertySetsassociation : a reference to an array of objects of typeBio::MAGE::NameValueType - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array classBio::MAGE::NameValueTypeinstances
- Input parameters: the value to which the
$array_ref = $protocol->getPropertySets()β the restricted getter for thepropertySetsassociation.- Input parameters: none
- Return value: the current value of the
propertySetsassociation : a reference to an array of objects of typeBio::MAGE::NameValueType - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $protocol->addPropertySets(@vals)β because thepropertySetsassociation has list cardinality, it may store more than one value. This method adds the current list of objects in thepropertySetsassociation. π«Ά- Input parameters: the list of values
@valsto add to thepropertySetsassociation. NOTE: submitting a single value is permitted. - Return value: the number of items stored in the slot after adding
@vals - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::NameValueType
- Input parameters: the list of values
hardwares π οΈ
Methods for the hardwares association.
From the MAGE-OM documentation:
Hardware used by this protocol.
$array_ref = $protocol->setHardwares($array_ref)β the restricted setter for thehardwaresassociation.- Input parameters: the value to which the
hardwaresassociation will be set : a reference to an array of objects of typeBio::MAGE::Protocol::Hardware
- Input parameters: the value to which the
- Return value: the current value of the
hardwaresassociation β aka a reference to an array ofBio::MAGE::Protocol::Hardwareobjects π- Side effects: none, we behave β¨
- Exceptions: it's gonna call
croak()on you if you give it no input parameters at all, or if you give it too many input parameters, or if$array_refis not a reference to an array of classBio::MAGE::Protocol::Hardwareinstances. like bestie, it's picky and that's iconic π
$array_ref = $protocol->getHardwares()β the restricted getter for thehardwaresassociation.- Input parameters: none. not a single one. zero. nada π
- Return value: the current value of the
hardwaresassociation β a reference to an array of objects of typeBio::MAGE::Protocol::HardwareπΈ - Side effects: none π¦
- Exceptions: will call
croak()if ANY input parameters are specified. yes, even one. don't test her π
$val = $protocol->addHardwares(@vals)β because thehardwaresassociation has list cardinality, it can hold more than one value, and this method adds the current list of objects in thehardwaresassociation. it's giving collection energy π- Input parameters: the list of values
@valsto add to thehardwaresassociation. NOTE: submitting a single value is permitted β she's flexible like that π«Ά - Return value: the number of items stored in the slot after adding
@valsπ’ - Side effects: none β¨
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::Protocol::Hardwareπ
- Input parameters: the list of values
π¦ softwares
Methods for the softwares association.
From the MAGE-OM documentation:
Software used by this Protocol.
$array_ref = $protocol->setSoftwares($array_ref)β the restricted setter for thesoftwaresassociation.- Input parameters: the value to which the
softwaresassociation will be set β a reference to an array of objects of typeBio::MAGE::Protocol::Softwareπ - Return value: the current value of the
softwaresassociation β a reference to an array of objects of typeBio::MAGE::Protocol::Softwareβ¨ - Side effects: none π
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array of classBio::MAGE::Protocol::Softwareinstances π€
- Input parameters: the value to which the
$array_ref = $protocol->getSoftwares()β the restricted getter for thesoftwaresassociation.- Input parameters: none π
- Return value: the current value of the
softwaresassociation β a reference to an array of objects of typeBio::MAGE::Protocol::Softwareπ - Side effects: none π¦
- Exceptions: will call
croak()if any input parameters are specified. any. at all. π
$val = $protocol->addSoftwares(@vals)β since thesoftwaresassociation has list cardinality, it may store more than one value, and this method adds the current list of objects in thesoftwaresassociation. stack 'em up bestie π- Input parameters: the list of values
@valsto add to thesoftwaresassociation. NOTE: submitting a single value is permitted π - Return value: the number of items stored in the slot after adding
@valsπ’ - Side effects: none β¨
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::Protocol::Softwareπ
- Input parameters: the list of values
π descriptions
Methods for the descriptions association.
From the MAGE-OM documentation:
Free hand text descriptions. Makes available the associations of Description to an instance of Describable.
$array_ref = $protocol->setDescriptions($array_ref)β the restricted setter for thedescriptionsassociation.- Input parameters: the value to which the
descriptionsassociation will be set β a reference to an array of objects of typeBio::MAGE::Description::DescriptionπΈ - Return value: the current value of the
descriptionsassociation β a reference to an array of objects of typeBio::MAGE::Description::Descriptionβ¨ - Side effects: none π
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array of classBio::MAGE::Description::Descriptioninstances π€
- Input parameters: the value to which the
$array_ref = $protocol->getDescriptions()β the restricted getter for thedescriptionsassociation.- Input parameters: none π«Ά
- Return value: the current value of the
descriptionsassociation β a reference to an array of objects of typeBio::MAGE::Description::Descriptionπ - Side effects: none π
- Exceptions: will call
croak()if any input parameters are specified π
$val = $protocol->addDescriptions(@vals)β thedescriptionsassociation has list cardinality, so it may store more than one value, and this method adds the current list of objects in thedescriptionsassociation. tell her everything π¬- Input parameters: the list of values
@valsto add to thedescriptionsassociation. NOTE: submitting a single value is permitted π - Return value: the number of items stored in the slot after adding
@valsπ’ - Side effects: none β¨
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::Description::Descriptionπ
- Input parameters: the list of values
π security
Methods for the security association.
From the MAGE-OM documentation:
Information on the security for the instance of the class.
$val = $protocol->setSecurity($val)β the restricted setter for thesecurityassociation. main character locked down π- Input parameters: the value to which the
securityassociation will be set β one of the accepted enumerated values π - Return value: the current value of the
securityassociation β one of the accepted enumerated values π - Side effects: none π¦
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$valis not an instance of classBio::MAGE::AuditAndSecurity::Securityπ
- Input parameters: the value to which the
$val = $protocol->getSecurity()β the restricted getter for thesecurityassociation.- Input parameters: none π
- Return value: the current value of the
securityassociation β an instance of typeBio::MAGE::AuditAndSecurity::Securityπ - Side effects: none β¨
- Exceptions: will call
croak()if any input parameters are specified π
π§ type
Methods for the type association.
From the MAGE-OM documentation:
The type of a Protocol, a user should provide/use a recommended vocabulary. Examples of types include: RNA extraction, array washing, etc...
$val = $protocol->setType($val)β the restricted setter for thetypeassociation.- Input parameters: the value to which the
typeassociation will be set β one of the accepted enumerated values π - Return value: the current value of the
typeassociation β one of the accepted enumerated values π - Side effects: none π
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$valis not an instance of classBio::MAGE::Description::OntologyEntryπ
- Input parameters: the value to which the
$val = $protocol->getType()β the restricted getter for thetypeassociation.- Input parameters: none π«Ά
- Return value: the current value of the
typeassociation β an instance of typeBio::MAGE::Description::OntologyEntryπ - Side effects: none β¨
- Exceptions: will call
croak()if any input parameters are specified π€
and then there's this lil guy, just vibing at the end, doing the absolute least and doing it flawlessly:
sub initialize {
my $self = shift;
return 1;
}
she literally just returns 1. no thoughts, head empty, slaying anyway π
β¨
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
okay bestie, so in the Perl implementation of MAGE-OM classes there are literally three types of class data members and you need to know all of them: slots, attributes, and associations. let's break it down π
πΈ SLOTS πΈ
so this API uses the term "slot" to mean a data member of the class that was not present in the UML model β it's mostly for internal purposes. so like, use only if you understand the inner workings of the API, fr fr. most often slots get used by generic methods, like the ones in the XML writing and reading classes. iykyk π«Ά
slots are implemented using unified getter/setter methods:
$var = $obj->slot_name();β retrieves the current value of the slot β¨$new_var = $obj->slot_name($new_var);β stores$new_varin the slot, and the return value is also$new_var(cute, right?)@names = $obj->get_slot_names()β returns the list of all slots in the class π
DATA CHECKING: no data type checking is made for these methods. none. zero. nada. so like, be careful bestie π
π¦ ATTRIBUTES AND ASSOCIATIONS π¦
the terms "attribute" and "association" mean data members of the class that were specified directly from the UML model. so these ones are the real ones π
in the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented using three separate methods:
get*β retrieves the current value.
NOTE: for associations, if the association has list cardinality, an array reference is returned. DATA CHECKING: ensure that no argument is provided. like, don't pass anything, okay? π
set*β sets the current value, replacing any existing value.
NOTE: for associations, if the association has list cardinality, the argument must be an array reference. because of this, you probably should be using the add* methods instead (just saying π
). DATA CHECKING: for attributes, ensure that a single value is provided as the argument. for associations, if the association has list cardinality, ensure that the argument is a reference to an array of instances of the correct MAGE-OM class β otherwise ensure that there is a single argument of the correct MAGE-OM class. so like, get the type right or it's not gonna go well bestie π
add*β
NOTE: only present in associations with list cardinality. if it's not there, that's why.
appends a list of objects to any values that may already be stored in the association. it's giving "adding to the collection" energy β¨
DATA CHECKING: ensure that all arguments are of the correct MAGE-OM class. every single one. no exceptions π
π GENERIC METHODS π
the unified base class of all MAGE-OM classes, Bio::MAGE::Base, provides a set of generic methods that will operate on slots, attributes, and associations. it's giving main character energy fr:
$val = $obj->get_slot($name)
\@list_ref = $obj->get_slots(@name_list);
$val = $obj->set_slot($name,$val)
$obj->set_slots(%parameters)
$obj->set_slots(\@name_list, \@value_list)
see elsewhere in this page for a detailed description of these methods π (they're in the earlier part, bestie, go look)
π BUGS π
please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net) β like, actually send them, we wanna know π
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org) β iconic behavior honestly π
π SEE ALSO π
π«Ά POD ERRORS π«Ά
hey! the above document had some coding errors, which are explained below:
- around line 456:
'=item' outside of any '=over' - around line 541: you forgot a
'=back'before a'=head2' - around line 929: expected
'=item 2' - around line 934: expected
'=item 3' - around line 939: expected
'=item 4'
not the POD errors π the docs are still serving though, periodt.
and that's the whole page bestie!! this one came from perl v5.32.0 and it was dated 2020-11-27 β yes, that's the version and the date, right there at the bottom of the original. slay πβ¨ go forth and write some MAGE-OM classes, you got this π¦πΈ
π¦ 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