The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::GData::Feed::Link - Represent an xml Link tag.

SYNOPSIS

    use WebService::GData::Feed;
    
    my $feed = new WebService::GData::Feed($jsonfeed);
    
   my $links=  $feed->links();
   
   foreach my $link (@$links){
       #print $link->rel,$link->type, $link->href;
   }

DESCRIPTION

inherits from WebService::GData

This package wraps the link data found in a feed using the json format of the Google Data API v2 (no other format is supported!).

CONSTRUCTOR

new

    Accept the content of the link tag from a feed that has been perlified (from_json($json_string)).

    Parameters

    Returns

    Throws

    WebService::GData::Error - invalid_parameter_type if it is not an hash reference.

    Example:

        use WebService::GData::Feed::Link;
        
        my $link = new WebService::GData::Feed::Link($jsonfeed->{link}->[0]);
        
        #or
        my $link = new WebService::GData::Feed::Link({
            rel =>"alternate",
            type => "text/html",
            href => "http://www.youtube.com"
        });    
        
        $link->rel();#alternate

GET/SET METHODS

rel

    get/set the rel of the link.

    Parameters

    none - as a getter
    rel:Scalar as a setter

    Returns

    none - as a setter
    rel:Scalar as a getter

    Example:

        use WebService::GData::Feed::Author;
        
        my $link = new WebService::GData::Feed::Author($jsonfeed->{link}->[0]);
        
        $link->rel("alternate");
        
        $link->rel();#alternate

type

    get/set the type of the link.

    Parameters

    none - as a getter
    type:Scalar as a setter

    Returns

    none - as a setter
    type:Scalar as a getter

    Example:

        use WebService::GData::Feed::Author;
        
        my $link = new WebService::GData::Feed::Author($jsonfeed->{link}->[0]);
        
        $link->type("text/html");
        
        $link->type();#text/html

href

    get/set the href of the link.

    Parameters

    none - as a getter
    href:Scalar as a setter

    Returns

    none - as a setter
    href:Scalar as a getter

    Example:

        use WebService::GData::Feed::Author;
        
        my $link = new WebService::GData::Feed::Author($jsonfeed->{link}->[0]);
        
        $link->href("http://www.google.com/");
        
        $link->href();#http://www.google.com/

BUGS AND LIMITATIONS

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

AUTHOR

shiriru <shirirulestheworld[arobas]gmail.com>

LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.