HTML::Microformats::Format(3pm) | User Contributed Perl Documentation | HTML::Microformats::Format(3pm) |
HTML::Microformats::Format - base microformat class
HTML::Microformats::Format cannot be instantiated directly but many other classes inherit from it.
The constructors cannot actually be called on this package. Call them on descendent classes instead.
There are a number of property accessor methods defined via Perl's AUTOLOAD mechanism.
For any microformat property (e.g. 'fn' in hCard) there are get_X, set_X, add_X and clear_X methods defined.
"get_X": for singular properties, returns the value of property X. For plural properties, returns a list of values if called in list context, or the first value otherwise.
"set_X": for singular properties, sets the value of property X to the first given parameter. For plural properties, sets the values of property X to the list of parameters. This feature is deprecated and will be removed in a future release.
"add_X": for singular properties, sets the value of property X to the first given parameter, but croaks if X is already set. For concatenated singular properties, concatenates to the end of any existing value of X. For plural properties, adds any given parameters to the list of values of property X. This feature is deprecated and will be removed in a future release.
"clear_X": removes any values of property X, but croaks if the property is a required property. This feature is deprecated and will be removed in a future release.
For example, an HTML::Microformats::hCard object will have a method called get_fn which gets the value of the hCard's "fn" property, a method called set_fn which sets it, a method called add_fn which also sets it (but croaks if it's already set), and a method called clear_fn which croaks if called (because "fn" is a required property).
Deprecated features: the "set_X", "add_X" and "clear_X" methods are deprecated and will be removed soon. In general you should treat objects which are instances of HTML::Microformats::Format as read-only.
If $trine_obj is true, the return value is an RDF::Trine::Node object. Otherwise, it's a string (using the '_:' convention to identify blank nodes).
If $role is undefined, then returns the identifier for the object itself. If it's defined then it returns an identifier for a resource with a fixed relationship to the object.
$identifier_for_business_card = $hcard->id; $identifier_for_person = $hcard->id(undef, 'holder');
Please report any bugs to <http://rt.cpan.org/>.
HTML::Microformats.
Toby Inkster <tobyink@cpan.org>.
Copyright 2008-2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2021-09-12 | perl v5.32.1 |