GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
WebService::GData::Collection(3) User Contributed Perl Documentation WebService::GData::Collection(3)

WebService::GData::Collection - Composite class redispatching method calls to query the items data.

    use 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...
    }

inherits from WebService::GData::BaseCollection

This 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

"collection:ArrayRef" - (optional) an array reference of nodes or identic instances.

Returns

"WebService::GData::Collection" instance

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);

In 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();

If 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)!

shiriru <shirirulestheworld[arobas]gmail.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2011-01-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.