.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mail::Message::Field::AddrGroup 3" .TH Mail::Message::Field::AddrGroup 3 2024-01-06 "perl v5.38.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::Message::Field::AddrGroup \- A group of Mail::Message::Field::Address objects .SH INHERITANCE .IX Header "INHERITANCE" .Vb 4 \& Mail::Message::Field::AddrGroup \& is a User::Identity::Collection::Emails \& is a User::Identity::Collection \& is a User::Identity::Item .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& my $g = Mail::Message::Field::AddrGroup\->new(name => \*(Aqname\*(Aq); \& \& my $a = Mail::Message::Field::Address\->new(...); \& $g\->addAddress($a); \& \& my $f = Mail::Message::Field::Addresses\->new; \& $f\->addGroup($g); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" An address group collects a set of e\-mail addresses (in this case they are Mail::Message::Field::Address objects). .PP Extends "DESCRIPTION" in User::Identity::Collection::Emails. .SH OVERLOADED .IX Header "OVERLOADED" Extends "OVERLOADED" in User::Identity::Collection::Emails. .IP "overload: \fB@{}\fR" 4 .IX Item "overload: @{}" Inherited, see "OVERLOADED" in User::Identity::Collection .IP "overload: \fBstringification\fR" 4 .IX Item "overload: stringification" Returns the \fBstring()\fR value. .IP "overload: \fBstringification \fR" 4 .IX Item "overload: stringification " Inherited, see "OVERLOADED" in User::Identity::Collection .SH METHODS .IX Header "METHODS" Extends "METHODS" in User::Identity::Collection::Emails. .ie n .IP $obj\->\fBstring\fR() 4 .el .IP \f(CW$obj\fR\->\fBstring\fR() 4 .IX Item "$obj->string()" Returns the address group as string. When no name is specified, it will only be a comma separated list of addresses. With a name, the groups name will be prepended and a semi-colon appended. When no addresses where included and there is no name, then \f(CW\*(C`undef\*(C'\fR is returned. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in User::Identity::Collection::Emails. .ie n .IP $obj\->\fBcoerce\fR($object) 4 .el .IP \f(CW$obj\fR\->\fBcoerce\fR($object) 4 .IX Item "$obj->coerce($object)" Coerce an \f(CW$object\fR into a Mail::Message::Field::AddrGroup. Currently, you can only coerce User::Identity::Collection::Emails (which is the base class for this one) into this one. .ie n .IP "Mail::Message::Field::AddrGroup\->\fBnew\fR( [$name], %options )" 4 .el .IP "Mail::Message::Field::AddrGroup\->\fBnew\fR( [$name], \f(CW%options\fR )" 4 .IX Item "Mail::Message::Field::AddrGroup->new( [$name], %options )" Inherited, see "Constructors" in User::Identity::Collection::Emails .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in User::Identity::Collection::Emails. .ie n .IP $obj\->\fBdescription\fR() 4 .el .IP \f(CW$obj\fR\->\fBdescription\fR() 4 .IX Item "$obj->description()" Inherited, see "Attributes" in User::Identity::Item .ie n .IP $obj\->\fBitemType\fR() 4 .el .IP \f(CW$obj\fR\->\fBitemType\fR() 4 .IX Item "$obj->itemType()" Inherited, see "Attributes" in User::Identity::Collection .ie n .IP "$obj\->\fBname\fR( [$newname] )" 4 .el .IP "\f(CW$obj\fR\->\fBname\fR( [$newname] )" 4 .IX Item "$obj->name( [$newname] )" Inherited, see "Attributes" in User::Identity::Item .ie n .IP $obj\->\fBroles\fR() 4 .el .IP \f(CW$obj\fR\->\fBroles\fR() 4 .IX Item "$obj->roles()" Inherited, see "Attributes" in User::Identity::Collection .SS Collections .IX Subsection "Collections" Extends "Collections" in User::Identity::Collection::Emails. .ie n .IP "$obj\->\fBadd\fR($collection, $role)" 4 .el .IP "\f(CW$obj\fR\->\fBadd\fR($collection, \f(CW$role\fR)" 4 .IX Item "$obj->add($collection, $role)" Inherited, see "Collections" in User::Identity::Item .ie n .IP "$obj\->\fBaddCollection\fR( $object | <[$type], %options> )" 4 .el .IP "\f(CW$obj\fR\->\fBaddCollection\fR( \f(CW$object\fR | <[$type], \f(CW%options\fR> )" 4 .IX Item "$obj->addCollection( $object | <[$type], %options> )" Inherited, see "Collections" in User::Identity::Item .ie n .IP $obj\->\fBcollection\fR($name) 4 .el .IP \f(CW$obj\fR\->\fBcollection\fR($name) 4 .IX Item "$obj->collection($name)" Inherited, see "Collections" in User::Identity::Item .ie n .IP "$obj\->\fBparent\fR( [$parent] )" 4 .el .IP "\f(CW$obj\fR\->\fBparent\fR( [$parent] )" 4 .IX Item "$obj->parent( [$parent] )" Inherited, see "Collections" in User::Identity::Item .ie n .IP $obj\->\fBremoveCollection\fR($object|$name) 4 .el .IP \f(CW$obj\fR\->\fBremoveCollection\fR($object|$name) 4 .IX Item "$obj->removeCollection($object|$name)" Inherited, see "Collections" in User::Identity::Item .ie n .IP $obj\->\fBtype\fR() 4 .el .IP \f(CW$obj\fR\->\fBtype\fR() 4 .IX Item "$obj->type()" .PD 0 .IP Mail::Message::Field::AddrGroup\->\fBtype\fR() 4 .IX Item "Mail::Message::Field::AddrGroup->type()" .PD Inherited, see "Collections" in User::Identity::Item .ie n .IP $obj\->\fBuser\fR() 4 .el .IP \f(CW$obj\fR\->\fBuser\fR() 4 .IX Item "$obj->user()" Inherited, see "Collections" in User::Identity::Item .SS "Maintaining roles" .IX Subsection "Maintaining roles" Extends "Maintaining roles" in User::Identity::Collection::Emails. .ie n .IP "$obj\->\fBaddRole\fR($role| <[$name],%options> | ARRAY)" 4 .el .IP "\f(CW$obj\fR\->\fBaddRole\fR($role| <[$name],%options> | ARRAY)" 4 .IX Item "$obj->addRole($role| <[$name],%options> | ARRAY)" Inherited, see "Maintaining roles" in User::Identity::Collection .ie n .IP $obj\->\fBremoveRole\fR($role|$name) 4 .el .IP \f(CW$obj\fR\->\fBremoveRole\fR($role|$name) 4 .IX Item "$obj->removeRole($role|$name)" Inherited, see "Maintaining roles" in User::Identity::Collection .ie n .IP "$obj\->\fBrenameRole\fR( <$role|$oldname>, $newname )" 4 .el .IP "\f(CW$obj\fR\->\fBrenameRole\fR( <$role|$oldname>, \f(CW$newname\fR )" 4 .IX Item "$obj->renameRole( <$role|$oldname>, $newname )" Inherited, see "Maintaining roles" in User::Identity::Collection .ie n .IP $obj\->\fBsorted\fR() 4 .el .IP \f(CW$obj\fR\->\fBsorted\fR() 4 .IX Item "$obj->sorted()" Inherited, see "Maintaining roles" in User::Identity::Collection .SS Searching .IX Subsection "Searching" Extends "Searching" in User::Identity::Collection::Emails. .ie n .IP $obj\->\fBfind\fR($name|CODE|undef) 4 .el .IP \f(CW$obj\fR\->\fBfind\fR($name|CODE|undef) 4 .IX Item "$obj->find($name|CODE|undef)" Inherited, see "Searching" in User::Identity::Collection .SS Addresses .IX Subsection "Addresses" .ie n .IP $obj\->\fBaddAddress\fR(STRING|$address|%options) 4 .el .IP \f(CW$obj\fR\->\fBaddAddress\fR(STRING|$address|%options) 4 .IX Item "$obj->addAddress(STRING|$address|%options)" Add one e\-mail address to the list which is maintained in the group. This is a wrapper around \fBaddRole()\fR adding flexibility on how addresses are specified. An \f(CW$address\fR can be anything which is acceptable for \&\fBMail::Message::Field::Address::coerce()\fR or a list of options which will create such an object. .Sp example: of adding an address to an address group .Sp .Vb 2 \& my @data = (full_name => "Myself", address => \*(Aqme@tux.org\*(Aq); \& $group\->addAddress(@data); \& \& my $addr = Mail::Message::Field::Address\->new(@data); \& $group\->addAddress(@data); \& \& my $ma = Mail::Address\->new(...); \& $group\->addAddress($ma); .Ve .ie n .IP $obj\->\fBaddresses\fR() 4 .el .IP \f(CW$obj\fR\->\fBaddresses\fR() 4 .IX Item "$obj->addresses()" Returns all addresses defined in this group. The addresses will be ordered alphabetically to make automated testing possible: roles are stored in a hash, so have an unpredictable order by default. .Sp example: getting all addresses from a group .Sp .Vb 2 \& my @addrs = $group\->addresses; \& my @addrs = map { $_\->address } $self\->roles; #same .Ve .SS "Error handling" .IX Subsection "Error handling" .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: $object is not a collection." 4 .el .IP "Error: \f(CW$object\fR is not a collection." 4 .IX Item "Error: $object is not a collection." The first argument is an object, but not of a class which extends User::Identity::Collection. .ie n .IP "Error: Cannot coerce a $type into a Mail::Message::Field::AddrGroup" 4 .el .IP "Error: Cannot coerce a \f(CW$type\fR into a Mail::Message::Field::AddrGroup" 4 .IX Item "Error: Cannot coerce a $type into a Mail::Message::Field::AddrGroup" .PD 0 .ie n .IP "Error: Cannot create a $type to add this to my collection." 4 .el .IP "Error: Cannot create a \f(CW$type\fR to add this to my collection." 4 .IX Item "Error: Cannot create a $type to add this to my collection." .PD Some options are specified to create a \f(CW$type\fR object, which is native to this collection. However, for some reason this failed. .ie n .IP "Error: Cannot load collection module for $type ($class)." 4 .el .IP "Error: Cannot load collection module for \f(CW$type\fR ($class)." 4 .IX Item "Error: Cannot load collection module for $type ($class)." Either the specified \f(CW$type\fR does not exist, or that module named \f(CW$class\fR returns compilation errors. If the type as specified in the warning is not the name of a package, you specified a nickname which was not defined. Maybe you forgot the 'require' the package which defines the nickname. .ie n .IP "Error: Cannot rename $name into $newname: already exists" 4 .el .IP "Error: Cannot rename \f(CW$name\fR into \f(CW$newname:\fR already exists" 4 .IX Item "Error: Cannot rename $name into $newname: already exists" .PD 0 .ie n .IP "Error: Cannot rename $name into $newname: doesn't exist" 4 .el .IP "Error: Cannot rename \f(CW$name\fR into \f(CW$newname:\fR doesn't exist" 4 .IX Item "Error: Cannot rename $name into $newname: doesn't exist" .ie n .IP "Error: Creation of a collection via $class failed." 4 .el .IP "Error: Creation of a collection via \f(CW$class\fR failed." 4 .IX Item "Error: Creation of a collection via $class failed." .PD The \f(CW$class\fR did compile, but it was not possible to create an object of that class using the options you specified. .IP "Error: Don't know what type of collection you want to add." 4 .IX Item "Error: Don't know what type of collection you want to add." If you add a collection, it must either by a collection object or a list of options which can be used to create a collection object. In the latter case, the type of collection must be specified. .ie n .IP "Warning: No collection $name" 4 .el .IP "Warning: No collection \f(CW$name\fR" 4 .IX Item "Warning: No collection $name" The collection with \f(CW$name\fR does not exist and can not be created. .ie n .IP "Error: Wrong type of role for $collection: requires a $expect but got a $type" 4 .el .IP "Error: Wrong type of role for \f(CW$collection:\fR requires a \f(CW$expect\fR but got a \f(CW$type\fR" 4 .IX Item "Error: Wrong type of role for $collection: requires a $expect but got a $type" Each \f(CW$collection\fR groups sets of roles of one specific type ($expect). You cannot add objects of a different \f(CW$type\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail-Message distribution version 3.015, built on December 11, 2023. Website: \fIhttp://perl.overmeer.net/CPAN/\fR .SH LICENSE .IX Header "LICENSE" Copyrights 2001\-2023 by [Mark Overmeer ]. For other contributors see ChangeLog. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \fIhttp://dev.perl.org/licenses/\fR