[Bps-public-commit] net-lighthouse branch, master, updated. b0b66c1dc52a3f56f01f4106ab2b5389b639051e

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Sep 8 04:26:50 EDT 2009


The branch, master has been updated
       via  b0b66c1dc52a3f56f01f4106ab2b5389b639051e (commit)
      from  95db0b5f2749dfaa199e22b22b68d24be43ebcff (commit)

Summary of changes:
 lib/Net/Lighthouse.pm                           |   37 ++++++++--
 lib/Net/Lighthouse/Base.pm                      |   33 +++++++-
 lib/Net/Lighthouse/Project.pm                   |   93 ++++++++++++++++++++--
 lib/Net/Lighthouse/Project/Changeset.pm         |   62 +++++++++++++++-
 lib/Net/Lighthouse/Project/Message.pm           |   72 +++++++++++++++++-
 lib/Net/Lighthouse/Project/Milestone.pm         |   62 +++++++++++++++-
 lib/Net/Lighthouse/Project/Ticket.pm            |   89 ++++++++++++++++++++--
 lib/Net/Lighthouse/Project/Ticket/Attachment.pm |   37 ++++++++-
 lib/Net/Lighthouse/Project/Ticket/Version.pm    |   34 ++++++++-
 lib/Net/Lighthouse/Project/TicketBin.pm         |   68 ++++++++++++++++-
 lib/Net/Lighthouse/Token.pm                     |   48 +++++++++++-
 lib/Net/Lighthouse/User.pm                      |   41 ++++++++--
 lib/Net/Lighthouse/User/Membership.pm           |   24 ++++++
 lib/Net/Lighthouse/Util.pm                      |   22 +++++-
 14 files changed, 672 insertions(+), 50 deletions(-)

- Log -----------------------------------------------------------------
commit b0b66c1dc52a3f56f01f4106ab2b5389b639051e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Sep 8 16:26:39 2009 +0800

    pod update

diff --git a/lib/Net/Lighthouse.pm b/lib/Net/Lighthouse.pm
index 8c411f0..fcac308 100644
--- a/lib/Net/Lighthouse.pm
+++ b/lib/Net/Lighthouse.pm
@@ -46,7 +46,7 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse - 
+Net::Lighthouse - Perl interface to lighthouseapp.com
 
 
 =head1 VERSION
@@ -57,29 +57,54 @@ This document describes Net::Lighthouse version 0.01
 =head1 SYNOPSIS
 
     use Net::Lighthouse;
+    my $lh;
+    $lh = Net::Lighthouse->new(
+        account => 'foo',
+        auth    => { token => 'bla' },
+    );
+
+    $lh = Net::Lighthouse->new(
+        account => 'foo',
+        auth    => { email => 'bar at example.com', password => 'password' },
+    );
+
+    my @projects = $lh->projects;
+    my $project = $lh->project;
+    my $token = $lh->token;
+    my $user = $lh->user;
+
 
 =head1 DESCRIPTION
 
+L<Net::Lighthouse> is a Perl interface to lighthouseapp.com, by means of its official api.
 
 =head1 INTERFACE
 
+=over 4
 
+=item projects
 
-=head1 DEPENDENCIES
-
+return a list of projects, each isa L<Net::Lighthouse::Project>.
 
-None.
+=item project, token, user
 
+return a corresponding object, with account and auth prefilled if exist.
 
-=head1 INCOMPATIBILITIES
+=back
 
-None reported.
+=head1 DEPENDENCIES
 
+L<Any::Moose>, L<Params::Validate>, L<XML::Simple>, L<LWP>, L<MIME::Base64>,
+L<YAML::Syck>, L<DateTime>, L<URI::Escape>
 
 =head1 BUGS AND LIMITATIONS
 
 No bugs have been reported.
 
+=head1 SEE ALSO
+
+L<Net::Lighthouse::Base>, L<http://lighthouseapp.com/api>
+
 =head1 AUTHOR
 
 sunnavy  C<< <sunnavy at bestpractical.com> >>
diff --git a/lib/Net/Lighthouse/Base.pm b/lib/Net/Lighthouse/Base.pm
index ed93d8f..6286e6e 100644
--- a/lib/Net/Lighthouse/Base.pm
+++ b/lib/Net/Lighthouse/Base.pm
@@ -31,7 +31,7 @@ sub ua {
       LWP::UserAgent->new(
         agent => 'net-lighthouse/' . $Net::Lighthouse::VERSION );
     $ua->default_header( 'Content-Type' => 'application/xml' );
-    # email and password have high priority
+    # email and password have higher priority
     my $auth = $self->auth;
     if ( $auth->{email} && $auth->{password} ) {
         my $base64 = encode_base64( $auth->{email} . ':' . $auth->{password} );
@@ -51,17 +51,44 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Base - Base class
+Net::Lighthouse::Base - Base
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Base;
 
-=head1 DESCRIPTION
+=head1 ATTRIBUTES
 
+=over 4
+
+=item account
+
+read only, returns account string, e.g. 'foo' as in http://foo.lighthouseapp.com
+
+=item auth
+
+a hashref like { token => '... } or { email => '...', password => '...' }.
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item base_url
+
+the base_url string, e.g. 'http://foo.lighthouseapp.com'
+
+=item ua
+
+returns an L<LWP::UserAgent> object, with agent, content-type and auth stuff
+prefilled.
+
+=back
+
+=head1 SEE ALSO
+
+L<http://lighthouseapp.com/api/the-basics>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project.pm b/lib/Net/Lighthouse/Project.pm
index 7ae9ce8..25d80d5 100644
--- a/lib/Net/Lighthouse/Project.pm
+++ b/lib/Net/Lighthouse/Project.pm
@@ -207,7 +207,6 @@ sub list {
     my $res = $ua->get( $url );
     if ( $res->is_success ) {
         my $ps = XMLin( $res->content, KeyAttr => [] )->{project};
-        $ps = [$ps] unless ref $ps eq 'ARRAY';
         my @list = map {
             my $p = Net::Lighthouse::Project->new(
                 map { $_ => $self->$_ }
@@ -319,33 +318,109 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project - 
+Net::Lighthouse::Project - Project
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project;
+    my $project = Net::Lighthouse::Project->new(
+        account => 'foo',
+        auth    => { token => 'bla' },
+    );
+
+    $project->load( 35918 ); # load by id
+    $project->load( 'foo' ); # load by name
+
+    my $description = $project->description;
+    my $created_at = $project->created_at; # DateTime object, UTC based
+
+    my @projects   = $project->list;
+    my $ticket     = $project->ticket;
+    my @tickets    = $project->tickets;
+    my $bin        = $project->ticket_bin;
+    my @bins       = $project->ticket_bins;
+    my $changeset  = $project->changeset;
+    my @changesets = $project->changesets;
+    my $milestone  = $project->milestone;
+    my @milestones = $project->milestones;
+    my $message    = $project->message;
+    my @messages   = $project->messages;
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item created_at, updated_at
+
+ro, DateTime object, UTC based
+
+=item open_states_list, closed_states_list, open_states, closed_states
+
+ro, Array
+
+=item default_assigned_user_id, default_milestone_id, id, open_tickets_count
+
+ro, Maybe Int
+
+=item hidden, send_changesets_to_events
+
+ro, Bool
 
-=head1 DESCRIPTION
+=item description, description_html, permalink, access, license
 
+ro, Maybe Str
+
+=item archived, public
+
+rw, Bool
+
+=item name
+
+rw, Bool
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item projects, changesets, tickets, ticket_bins, messages, milestones
+
+return a list of corresponding object
+
+=item changeset, ticket, ticket_bin, message, milestone
+
+return a corresponding object, with account and auth prefilled if exist.
+
+=item create( name => '', archived => '', public => '' )
+
+create a project, return true if succeeded
+
+=item update( name => '', archived => '', public => '' )
+
+update the project, return true if succeeded
+
+=item delete
 
+delete the project, return true if succeeded
 
-=head1 DEPENDENCIES
+=item list
 
+return a list of projects, each isa L<Net::Lighthouse::Project>
 
-None.
+=item load( $id | $name ), load_from_xml( $hahsref | $xml_string )
 
+load a project, return loaded project object
 
-=head1 INCOMPATIBILITIES
+=item initial_state
 
-None reported.
+return hashref, carrying the initial_state info
 
+=back
 
-=head1 BUGS AND LIMITATIONS
+=head1 SEE ALSO
 
-No bugs have been reported.
+L<http://lighthouseapp.com/api/projects>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/Changeset.pm b/lib/Net/Lighthouse/Project/Changeset.pm
index 83ef5ba..9b59b60 100644
--- a/lib/Net/Lighthouse/Project/Changeset.pm
+++ b/lib/Net/Lighthouse/Project/Changeset.pm
@@ -174,17 +174,75 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::Changeset - 
+Net::Lighthouse::Project::Changeset - Project Changeset
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::Changeset;
+    my $changeset = Net::Lighthouse::Project:;Changeset->new(
+        account    => 'sunnavy',
+        auth       => { token => '' },
+        project_id => 12345,
+    );
+    $changeset->load( 1 );
+    print $changeset->title;
+    $changeset->delete;
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item project_id user_id
+
+ro, Int
+
+=item body_html
+
+ro, Maybe Str
 
-=head1 DESCRIPTION
+=item changed_at
 
+rw, DateTime
+
+=item changes
+
+rw, ArrayRef
+
+=item body, title, revision
+
+rw, Maybe Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load( $revision ), load_from_xml( $hashref | $xml_string )
+
+load a changeset, return the loaded changeset object
+
+=item create( revision => '', body => '', title => '', changes => '', changed_at => '', )
+
+create a changeset, return true if succeeded
+
+=item delete
+
+delete the changeset, return true if succeeded
+
+=item list
+
+return a list of changesets, each isa L<Net::Lighthouse::Project::Changeset>.
+
+=item initial_state
+
+return hashref, carrying the initial_state info
+
+=back
+
+=head1 SEE ALSO
+
+L<http://lighthouseapp.com/api/changesets>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/Message.pm b/lib/Net/Lighthouse/Project/Message.pm
index ab1fff3..f4bdbcb 100644
--- a/lib/Net/Lighthouse/Project/Message.pm
+++ b/lib/Net/Lighthouse/Project/Message.pm
@@ -148,7 +148,7 @@ sub create_comment {
         $args{$field} = { content => $args{$field} };
     }
 
-    # doc says <message>, but it doesn't work actually.
+    # TODO doc says <message>, but it doesn't work actually.
     # comment can work, though still with a problem
     my $xml = XMLout( { comment => \%args }, KeepRoot => 1);
     my $ua = $self->ua;
@@ -281,17 +281,83 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::Message - 
+Net::Lighthouse::Project::Message - Project Message
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::Message;
+    my $message = Net::Lighthouse::Project::Message->new(
+        account    => 'sunnavy',
+        auth       => { token => '' },
+        project_id => 12345,
+    );
+    $message->load( 1 );
+    print $message->title;
+    $message->delete;
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item created_at, updated_at
+
+ro, Maybe DateTime
+
+=item id, user_id, parent_id, comments_count, project_id, all_attachments_count, attachments_count
+
+ro, Maybe Int
+
+=item body_html, user_name, permalink, url
 
-=head1 DESCRIPTION
+ro, Maybe Str
 
+=item comments
+
+ro, ArrayRef of Net::Lighthouse::Project::Message
+
+=item title body
+
+rw, Maybe Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load( $id ), load_from_xml( $hashref | $xml_string )
+
+load a message, return the loaded message object
+
+=item create( title => '', body => '' );
+
+create a message, return true if succeeded
+
+=item create_comment( body => '' );
+
+create a comment, return true if succeeded
+
+=item update( title => '', body => '' );
+
+update a message, return true if succeeded
+
+=item delete
+
+delete the message, return true if succeeded
+
+=item list
+
+return a list of messages, each isa L<Net::Lighthouse::Project::Message>.
+
+=item initial_state
+
+return hashref, carrying the initial_state info
+
+=back
+
+=head1 SEE ALSO
+
+L<http://lighthouseapp.com/api/messages>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/Milestone.pm b/lib/Net/Lighthouse/Project/Milestone.pm
index b980ec6..5912d25 100644
--- a/lib/Net/Lighthouse/Project/Milestone.pm
+++ b/lib/Net/Lighthouse/Project/Milestone.pm
@@ -216,17 +216,75 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::Milestone - 
+Net::Lighthouse::Project::Milestone - Project Milestone
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::Milestone;
+    my $milestone = Net::Lighthouse::Project::Milestone->new(
+        account    => 'sunnavy',
+        auth       => { token => '' },
+        project_id => 12345,
+    );
+    $milestone->load( 1 );
+    print $milestone->title;
+    $milestone->delete;
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item created_at, updated_at
+
+ro, Maybe DateTime
+
+=item open_tickets_count, id, project_id, tickets_count
+
+ro, Int
 
-=head1 DESCRIPTION
+=item goals_html, user_name, permalink, url
 
+ro, Maybe Str
+
+=item title, goals, due_on
+
+rw, Maybe Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load( $id | $name ), load_from_xml( $hashref | $xml_string )
+
+load a milestone, return the loaded milestone object
+
+=item create( goals => '', title => '', due_on => '' )
+
+create a milestone, return true if succeeded
+
+=item update( goals => '', title => '', due_on => '' )
+
+update a milestone, return true if succeeded
+
+=item delete
+
+delete the milestone, return true if succeeded
+
+=item list
+
+return a list of milestones, each isa L<Net::Lighthouse::Project::Milestone>
+
+=item initial_state
+
+return hashref, carrying the initial_state info
+
+=back
+
+=head1 SEE ALSO
+
+L<http://lighthouseapp.com/api/milestones>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/Ticket.pm b/lib/Net/Lighthouse/Project/Ticket.pm
index 8cfc257..1bc0b21 100644
--- a/lib/Net/Lighthouse/Project/Ticket.pm
+++ b/lib/Net/Lighthouse/Project/Ticket.pm
@@ -21,11 +21,10 @@ has [qw/closed /] => (
 );
 
 has [
-    'raw_data',     'user_name',
-    'state',        'permalink',
-    'url',          'latest_body',
-    'creator_name', 'assigned_user_name',
-    'milestone_title',
+    'raw_data',           'user_name',
+    'permalink',          'url',
+    'latest_body',        'creator_name',
+    'assigned_user_name', 'milestone_title',
   ] => (
     isa => 'Maybe[Str]',
     is  => 'ro',
@@ -313,17 +312,93 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::Ticket - 
+Net::Lighthouse::Project::Ticket - Project Ticket
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::Ticket;
+    my $ticket = Net::Lighthouse::Project::Ticket->new(
+        account    => 'sunnavy',
+        auth       => { token => '' },
+        project_id => 12345
+    );
+    $ticket->load( 1 );
+    print $ticket->state;
+    $ticket->delete;
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item created_at, updated_at, milestone_due_on
+
+ro, Maybe DateTime
+
+=item number, priority, user_id, project_id, creator_id, attachments_count,
+
+ro, Maybe Int
+
+=item closed
+
+ro, Bool
+
+=item raw_data, user_name, permalink, url, latest_body, creator_name, assigned_user_name, milestone_title
+
+ro, Maybe Str
+
+=item attachments
+
+ro, ArrayRef of Net::Lighthouse::Project::Ticket::Attachment
+
+=item versions
+
+ro, ArrayRef of Net::Lighthouse::Project::Ticket::Version
+
+=item assigned_user_id, milestone_id
+
+rw, Maybe Int
 
-=head1 DESCRIPTION
+=item title, state, tag,
 
+rw, Maybe Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load( $id ), load_from_xml( $hashref | $xml_string )
+
+load a ticket, return the loaded ticket object
+
+=item create( title => '', body  => '', state => '', assigned_user_id => '', milestone_id => '', tag => '', )
+
+create a ticket, return true if succeeded
+
+=item update( title => '', body  => '', state => '', assigned_user_id => '', milestone_id => '', tag => '', )
+
+update a ticket, return true if succeeded
+
+=item delete
+
+delete a ticket, return true if succeeded
+
+=item list( query => '', page => '' )
+
+return a list of tickets, each isa L<Net::Lighthouse::Project::Ticket>.
+
+NOTE: the ticket in this list doesn't load versions and attachments attrs
+
+=item initial_state
+
+return hashref, carrying the initial_state info
+
+=back
+
+=head1 SEE ALSO
+
+L<http://lighthouseapp.com/api/tickets>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/Ticket/Attachment.pm b/lib/Net/Lighthouse/Project/Ticket/Attachment.pm
index 4218c3f..0ba46c9 100644
--- a/lib/Net/Lighthouse/Project/Ticket/Attachment.pm
+++ b/lib/Net/Lighthouse/Project/Ticket/Attachment.pm
@@ -20,7 +20,8 @@ has [ 'content_type', 'filename', 'url', 'type', 'code' ] => (
     is  => 'ro',
 );
 
-has 'ua' => ( is => 'ro', );
+# make test happy, added Test::MockObject
+has 'ua' => ( is => 'ro', isa => 'LWP::UserAgent|Test::MockObject', );
 
 has 'content' => (
     is      => 'ro',
@@ -59,17 +60,47 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::Ticket::Attachment - 
+Net::Lighthouse::Project::Ticket::Attachment - Project Ticket Attachment
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::Ticket::Attachment;
 
-=head1 DESCRIPTION
+=head1 ATTRIBUTES
 
+=over 4
+
+=item created_at
+
+ro, DateTime, UTC based
+
+=item width, height, size, uploader_id, id
+
+ro, Maybe Int
+
+=item content_type, filename, url, type, code
+
+ro, Str
+
+=item ua
+
+ro, LWP::UserAgent
+
+=item content
+
+ro, Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load_from_xml( $hashref | $xml_string )
+
+load ticket attachment, return loaded ticket attachment
+
+=back
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/Ticket/Version.pm b/lib/Net/Lighthouse/Project/Ticket/Version.pm
index 84d3a4a..d494b69 100644
--- a/lib/Net/Lighthouse/Project/Ticket/Version.pm
+++ b/lib/Net/Lighthouse/Project/Ticket/Version.pm
@@ -61,17 +61,47 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::Ticket::Version - 
+Net::Lighthouse::Project::Ticket::Version - Project Ticket Version
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::Ticket::Version;
 
-=head1 DESCRIPTION
+=head1 ATTRIBUTES
 
+=over 4
+
+=item created_at, updated_at
+
+ro, DateTime, UTC based
+
+=item milestone_id, assigned_user_id, number, user_id, project_id, creator_id, attachments_count
+
+ro, Maybe Int
+
+=item closed
+
+ro, Bool
+
+=item diffable_attributes
+
+ro, HashRef
+
+=item assigned_user_name, body, body_html, permalink, state, tag, title, user_id, user_name, creator_name, url, milestone_title
+
+ro, Maybe Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load_from_xml( $hashref | $xml_string )
+
+load ticket version, return loaded ticket version
+
+=back
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Project/TicketBin.pm b/lib/Net/Lighthouse/Project/TicketBin.pm
index 3497540..b00e88f 100644
--- a/lib/Net/Lighthouse/Project/TicketBin.pm
+++ b/lib/Net/Lighthouse/Project/TicketBin.pm
@@ -214,14 +214,78 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Project::TicketBin - 
+Net::Lighthouse::Project::TicketBin - Project TicketBin
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Project::TicketBin;
+    my $bin = Net::Lighthouse::Project::TicketBin->new(
+        account    => 'sunnavy',
+        auth       => { token => '' },
+        project_id => 12345,
+    );
+    $bin->load( 1 );
+    print $bin->name;
+    $bin->delete;
+
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item updated_at
+
+ro, DateTime
+
+=item user_id, position, project_id, tickets_count, id
+
+ro, Int
+
+=item shared
+
+ro, Bool
+
+=item default
+
+rw, Bool
+
+=item name, query,
+
+rw, Maybe Str
+
+=back
+
+=head1 INTERFACE
+
+=over 4
+
+=item load( $id ), load_from_xml( $hashref | $xml_string )
+
+load a ticket bin, return the loaded ticket bin object
+
+=item create( name => '', query => '', default => '' );
+
+create a ticket bin, return true if succeeded
+
+=item update( name => '', query => '', default => '' );
+
+update a ticket bin, return true if succeeded
+
+=item delete
+
+delete the ticket bin, return true if succeeded
+
+=item list
+
+return a list of ticket bins, each isa L<Net::Lighthouse::Project::TicketBin>.
+
+=back
+
+=head1 SEE ALSO
 
-=head1 DESCRIPTION
+L<http://lighthouseapp.com/api/ticket-bins>
 
+=head1 ATTRIBUTES
 
 =head1 INTERFACE
 
diff --git a/lib/Net/Lighthouse/Token.pm b/lib/Net/Lighthouse/Token.pm
index 7256f7a..92e1413 100644
--- a/lib/Net/Lighthouse/Token.pm
+++ b/lib/Net/Lighthouse/Token.pm
@@ -74,17 +74,61 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Token - 
+Net::Lighthouse::Token - Token
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::Token;
+    my $token = Net::Lighthouse::Token->new(
+        account => 'sunnavy',
+        auth    => { token => '...' },
+    );
+    $token->load( 'abcdedf...' );
 
-=head1 DESCRIPTION
+=head1 ATTRIBUTES
 
+=over 4
+
+=item created_at
+
+ro, DateTime object, UTC based
+
+=item user_id
+
+ro, Int
+
+=item project_id
+
+ro, Maybe Int
+
+=item read_only
+
+ro, Bool
+
+=item token
+
+ro, Str
+
+=item account, note
+ro, Maybe Str
+
+=item
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load( $token_string ) load_from_xml( $hashref | $xml_string )
+
+load a token, return loaded token object
+
+=back
+
+=head1 SEE ALSO
+
+token part in L<http://lighthouseapp.com/api/users>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/User.pm b/lib/Net/Lighthouse/User.pm
index 650095f..7ad592b 100644
--- a/lib/Net/Lighthouse/User.pm
+++ b/lib/Net/Lighthouse/User.pm
@@ -118,33 +118,58 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::User - 
+Net::Lighthouse::User - User
 
 =head1 SYNOPSIS
 
     use Net::Lighthouse::User;
+    use Net::Lighthouse::User;
+    my $user = Net::Lighthouse::User->new(
+        account => 'sunnavy',
+        auth    => { token => '...' },
+    );
+    $user->load( 12345 );
+
+=head1 ATTRIBUTES
+
+=over 4
+
+=item id
+
+ro, Int
+
+=item avatar_url
+
+ro, Str
+
+=item name job website
 
-=head1 DESCRIPTION
+rw, Maybe Str
 
+=back
 
 =head1 INTERFACE
 
+=over 4
 
+=item load( $id ), load_from_xml( $hashref | $xml_string )
 
-=head1 DEPENDENCIES
+load user, return loaded user object
 
 
-None.
+=item update( name    => '', job => '', website => '' )
 
+update user, return true if succeed
 
-=head1 INCOMPATIBILITIES
+=item memberships
 
-None reported.
+return a list of memberships, each isa L<Net::Lighthouse::User::Membership>
 
+=back
 
-=head1 BUGS AND LIMITATIONS
+=head1 SEE ALSO
 
-No bugs have been reported.
+L<http://lighthouseapp.com/api/users>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/User/Membership.pm b/lib/Net/Lighthouse/User/Membership.pm
index d935db0..98f736b 100644
--- a/lib/Net/Lighthouse/User/Membership.pm
+++ b/lib/Net/Lighthouse/User/Membership.pm
@@ -57,9 +57,33 @@ Net::Lighthouse::User::Membership -
 
 =head1 DESCRIPTION
 
+=head1 ATTRIBUTES
+
+=over 4
+
+=item id, user_id
+
+ro, Int
+
+=item account, project
+
+ro, Str
+
+=back
 
 =head1 INTERFACE
 
+=over 4
+
+=item load_from_xml( $hashref | xml_string )
+
+load membership, return loaded membership
+
+=back
+
+=head1 SEE ALSO
+
+membership in L<http://lighthouseapp.com/api/users>
 
 =head1 AUTHOR
 
diff --git a/lib/Net/Lighthouse/Util.pm b/lib/Net/Lighthouse/Util.pm
index d082f84..ac528d9 100644
--- a/lib/Net/Lighthouse/Util.pm
+++ b/lib/Net/Lighthouse/Util.pm
@@ -77,7 +77,7 @@ __END__
 
 =head1 NAME
 
-Net::Lighthouse::Util - 
+Net::Lighthouse::Util - Util
 
 =head1 SYNOPSIS
 
@@ -85,9 +85,29 @@ Net::Lighthouse::Util -
 
 =head1 DESCRIPTION
 
+utility methods live here
 
 =head1 INTERFACE
 
+=over 4
+
+=item translate_from_xml( $hashref | $xml_string )
+
+translate from xml, the general translation map is:
+'foo-bar' => 'foo_bar',
+value bool false | true => 0 | 1,
+value yaml string => object
+value datetime string => L<DateTime> object
+
+=item datetime_from_string
+
+parse string to a L<DateTime> object, and translate its timezone to UTC
+
+=back
+
+=head1 SEE ALSO
+
+L<DateTime>, L<YAML::Syck>
 
 =head1 AUTHOR
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list