RDF::v...Entity(3pm)
β¨ RDF::vCard::Entity β the whole vibe π³
okay so bestie, this is RDF::vCard::Entity β it's the class that represents one single vCard. like, one whole contact card, one little entity, just vibing on its own. and ngl it's lowkey built to be a little more flexible than that, because it could potentially be used as the basis for other RFC 2425-based formats too, like iCalendar. it's giving "main character but also willing to share the spotlight." π
πΈ DESCRIPTION πΈ
Every instance of this class corresponds to an individual vCard object. fr fr, that's the whole point of it. but also β she's flexible β she could potentially be used as a basis for other RFC 2425-based formats such as iCalendar. versatile queen. π
π Constructor
new(%options)β returns a brand newRDF::vCard::Entityobject. fresh out the box, no cap.
The only option worth worrying about is profile, which sets the profile for the entity. it defaults to VCARD. that's the default. don't overthink it. β¨
Also, RDF::vCard::Entity overloads stringification, so you can literally do this:
my $vcard = RDF::vCard::Entity->new;
print $vcard if $vcard =~ /VCARD/i;
look at her go π¦
π§ Methods
to_string()β formats the object according to RFC 2425 and RFC 2426. the classic, the original, the blueprint. πto_jcard()β formats the object according to http://microformats.org/wiki/jcard. and heads up:to_jcard(1)will return the same data but without the JSON stringification. same snack, different presentation. πadd_to_model($model)β you hand it anRDF::Trine::Modeland it adds triples to the model for this entity. she's contributing to the graph. iconic. πnode()β returns anRDF::Trine::Node::Blankthat identifies this entity. it's her lil name tag. πentity_order()β returns a string along the lines of"Surname;Forename", which is useful for sorting a list of entities. alphabetize your besties, periodt. πprofile()β returns the entity type β e.g."VCARD". that's it, that's the tea. βlines()β returns an arrayref ofRDF::vCard::Lineobjects, in the order they were originally added. she remembers everything, in order. and just so you know: this excludes theBEGIN:VCARDandEND:VCARDlines. those two are not invited to this list. πadd($line)β add aRDF::vCard::Line. one line at a time, bestie. π«Άget($property)β returns a list ofRDF::vCard::Lineobjects for the given property. e.g.
print "It has an address!\n" if ($vcard->get('ADR'));
matches($property, $regexp)β checks to see if a property's value matches a regular expression. like a vibe check but for data. π
print "In London\n" if $vcard->matches(ADR => /London/);
add_component($thing)β adds a nested entity within this one. this method is unused for vCard, but it's a hook for the benefit ofRDF::iCalendar. so she's holding space for her friend. πcomponentsβ lists nested entities within this one. peek inside, see who's living in there. π₯
π SEE ALSO π
RDF::vCard.
π AUTHOR π
Toby Inkster <tobyink@cpan.org>.
π COPYRIGHT π
Copyright 2011 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie! π this was RDF::vCard::Entity(3pm) from the User Contributed Perl Documentation, running on perl v5.34.0, dated 2022-06-17. go forth and build your vCards, you absolute legend. slay. β¨π
π¦
π¦ where this page comes from
- debian bookworm: librdf-vcard-perl 0.012-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-vcard-perl 0.012-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms