[Bps-public-commit] r17519 - in Net-Google-Code/trunk: lib/Net/Google/Code
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Fri Jan 2 02:33:26 EST 2009
Author: sunnavy
Date: Fri Jan 2 02:33:26 2009
New Revision: 17519
Modified:
Net-Google-Code/trunk/ (props changed)
Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm
Log:
r18477 at sunnavys-mb: sunnavy | 2009-01-02 13:00:01 +0800
split parse part from load method
Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm (original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm Fri Jan 2 02:33:26 2009
@@ -40,15 +40,20 @@
*{ "Net::Google::Code::Ticket::" . $prop } = sub { shift->state->{$prop} };
}
-=head2 load
-
-=cut
-
sub load {
my $self = shift;
my ($id) = validate_pos( @_, { type => SCALAR } );
$self->state->{id} = $id;
my $content = $self->connection->_fetch( "/issues/detail?id=" . $id );
+ $self->parse( $content );
+ return $id;
+}
+
+
+sub parse {
+ my $self = shift;
+ my $content = shift;
+
require HTML::TreeBuilder;
my $tree = HTML::TreeBuilder->new;
$tree->parse_content($content);
@@ -139,7 +144,6 @@
push @{$self->comments}, $object;
}
- return $id;
}
no Moose;
@@ -157,6 +161,10 @@
=head1 INTERFACE
+=head2 load
+
+=head2 parse
+
=head2 id
=head2 status
More information about the Bps-public-commit
mailing list