Net::Plazes::User - representation of remote resource http://plazes.com/users(.*)


Net-Plazes documentation Contained in the Net-Plazes distribution.

Index


Code Index:

NAME

Top

Net::Plazes::User - representation of remote resource http://plazes.com/users(.*)

VERSION

Top

$Revision$

SYNOPSIS

Top

DESCRIPTION

Top

SUBROUTINES/METHODS

Top

service

fields - list of accessors for resources of this type

 my @aFields = $oObj->fields();

activities - Arrayref of Net::Plazes::Activity objects for this user

 my $arActivities = $oUser->activities();

accessors

id
created_at
full_name
name
updated_at
avatar_url

DIAGNOSTICS

Top

CONFIGURATION AND ENVIRONMENT

Top

DEPENDENCIES

Top

strict
warnings
base
Net::Plazes::Base

INCOMPATIBILITIES

Top

BUGS AND LIMITATIONS

Top

AUTHOR

Top

$Author: Roger Pettett$

LICENSE AND COPYRIGHT

Top


Net-Plazes documentation Contained in the Net-Plazes distribution.

#########
# Author:        rmp
# Maintainer:    $Author: rmp $
# Created:       2008-08-13
# Last Modified: $Date$
# Id:            $Id$
# $HeadURL$
#
package Net::Plazes::User;
use strict;
use warnings;
use base qw(Net::Plazes::Base);
use Net::Plazes::Activity;

our $VERSION = '0.03';

__PACKAGE__->mk_accessors(fields());
__PACKAGE__->has_many();

sub service {
  return q[http://plazes.com/users];
}

sub fields {
  return qw(id created_at full_name name updated_at avatar_url);
}

sub activities {
  my $self     = shift;

  if(!$self->id()) {
    return [];
  }

  if(!$self->{activities}) {
    my $obj_uri  = sprintf '%s/%d/activities', $self->service(), $self->id();
    my $root_activity = Net::Plazes::Activity->new({
						    useragent => $self->useragent(),
						   });
    $root_activity->list($obj_uri);
    $self->{activities} = $root_activity->activities();
  }

  return $self->{activities};
}

1;
__END__