NAME
Text::vCard::Part - Parent object to handle several parts of a vCard
SYNOPSIS
package YOUR_PACKAGE_NAME_HERE;
use base qw(Text::vCard::Part);
sub config {
my %config = (
# If the package refers to a part with multipul values
'field_names' => ['pobox','extad',...],
);
return \%config;
}
DESCRIPTION
This package can be inherited from when additional parts of a vCard need to become objects, such as Address and Name. The created objects are called from Text::vCard so this probably isn't something you want to do unless your helping maintain Text::vCard as well!
METHODS
types()
my @types = $part->types();
or
my $types = $part->types();
This method will return an array or an array ref depending on the calling context of types associated with the $part.
is_type()
if($part->is_type($type) {
# ...
}
Given a type (see types() for a list of possibilities) this method returns 1 if the $part is of that type or undef if it is not.
add_type()
$address->add_type('home');
Add a type to an address.
remove_type()
$address->remove_type('home');
This method removes a type from an address.
update_value()
my $value = $part->update_value();
This method updates and returns the value string of a part. It is only needs to be called when exporting the information back out to ensure that it has not been altered.
NOTE: considered running it everytime a field was updated but that seemed like overkill.
EXPORT
None by default.
AUTHOR
Leo Lapworth, LLAP@cuckoo.org
SEE ALSO
Text::vCard.