TM::ResourceAble
Topic Maps, abstract trait for resource-backed Topic Maps
- Provided by: libtm-perl (Version: 1.56-7)
- Report a bug
Topic Maps, abstract trait for resource-backed Topic Maps
package MyNiftyMap;
use TM;
use base qw(TM);
use Class::Trait ('TM::ResourceAble');
1;
my $tm = new MyNiftyMap;
$tm->url ('http://nirvana/');
warn $tm->mtime;
# or at runtime even:
use TM;
Class::Trait->apply ('TM', qw(TM::ResourceAble));
my $tm = new TM;
warn $tm->mtime;
This traits adds methods to provide the role resource to a map. That allows a map to be associated with a resource which is addressed by a URL (actually a URI for that matter).
The following resources, actually their URIs are predefined:
Example:
inlined:donald (duck)
$tm->url ($url)
Once an object of this class is instantiated it keeps the URL of the resource to which it is associated. With this method you can retrieve and set that. No special further action is taken otherwise.
This function returns the UNIX time when the resource has been modified last. 0 is returned if the result cannot be determined. All methods from LWP are supported.
Special resources are treated as follows:
TM
Copyright 200[67], Robert Barta <drrho@cpan.org>, All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html