|
NAMEWebService::GData::Collection - Composite class redispatching method calls to query the items data.SYNOPSISuse WebService::GData::Collection; #array ref of link nodes my $links = new WebService::GData::Collection($links); #search through the nodes for a certain value my $reponse_url = $links->rel('video.responses')->[0]; #access the object as if it was an array reference $links->[0]; #loop through it as if it was a normal array reference foreach my $link (@$links) { #$link->rel... } DESCRIPTIONinherits from WebService::GData::BaseCollectionThis package accepts an array reference containing identic nodes (link nodes, category nodes,video nodes...). Once feed with some data, you can call a node method by specifying a search string. The instance will simply redispatch the call to all its children and return any children that match(=~m/$search/) your query. CONSTRUCTOR new Create a Collection instance.
Parameters
Returns
Example use WebService::GData::Collection; my $collection = new WebService::GData::Collection(); $collection->[0] = new WebService::GData::Node::AuthorEntity(); or my $collection = new WebService::GData::Collection(\@authors); OVERLOADIn order to fake array reference behavior, the array
reference context is overloaded to return the actual array stored in the
instance.
Example use WebService::GData::Collection; my $authors = new WebService::GData::Collection(\@authors); foreach my $author (@$authors) { $author->name; } push @$author,new WebService::GData::Node::AuthorEntity(); BUGS AND LIMITATIONSIf you do me the favor to _use_ this module and find a bug, please email me i will try to do my best to fix it (patches welcome)!AUTHORshiriru <shirirulestheworld[arobas]gmail.com>LICENSE AND COPYRIGHTThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |