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

NAME

WebService::GData::Feed::Category - Represent an xml category tag.

SYNOPSIS

    use WebService::GData::Feed;
    
    my $feed = new WebService::GData::Feed($jsonfeed);
    
    my $categories=  $feed->category();
   
    foreach my $category (@$categories){
       #print $category->scheme,$category->term,$category->label;
    }

DESCRIPTION

inherits from WebService::GData::Feed

This package wraps the category 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 category tag from a feed that has been perlified (from_json($json_string)).

    Parameters

    category_info:HashRef - category data coming from a json feed.

    Returns

    WebService::GData::Feed::Category

    Throws

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

    Example:

        use WebService::GData::Feed::Category;
        
        my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]);
        
        #or
        my $category = new WebService::GData::Feed::Category({
            scheme => 'http://gdata.youtube.com/schemas/2007/categories.cat',
            term => 'Shows',
            label => 'Shows',
        });    
        
        $category->term();#Shows

GET/SET METHODS

scheme

    get/set the scheme of the category.

    Parameters

    none - as a getter
    scheme:Scalar as a setter

    Returns

    none - as a setter
    scheme:Scalar as a getter

    Example:

        use WebService::GData::Feed::Category;
        
        my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]);
        
        $category->scheme("http://schemas.google.com/g/2005#kind");
        
        $category->scheme();#http://schemas.google.com/g/2005#kind

term

    get/set the term of the category.

    Parameters

    none - as a getter
    term:Scalar as a setter

    Returns

    none - as a setter
    term:Scalar as a getter

    Example:

        use WebService::GData::Feed::Category;
        
        my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]);
        
        $category->term("http://gdata.youtube.com/schemas/2007#video");
        
        $category->term();#http://gdata.youtube.com/schemas/2007#video

label

    get/set the label of the category.

    Parameters

    none - as a getter
    label:Scalar as a setter

    Returns

    none - as a setter
    label:Scalar as a getter

    Example:

        use WebService::GData::Feed::Category;
        
        my $category = new WebService::GData::Feed::Category($jsonfeed->{category}->[0]);
        
        $category->label("comedy");
        
        $category->label();#comedy

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.