YMSG/GoesOnline.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 32 CC 3 SCAR 18.4
CC
3
Cov
0%
source
12.0
from
2.0
to_string
2.0
CRAP 6.3
1 package Net::YMSG::GoesOnline;
2 use base 'Net::YMSG::Event';
3 use strict;
4  
5 sub source
6 {
7 my $self = shift;
8 if (@_) {
9 $self->SUPER::source(@_);
10 my $yahoo = $self->get_connection;
11 my ($buddy) = grep {
12 $_->name eq lc $self->from
13 } $yahoo->buddy_list;
14 return unless $buddy;
15  
16 $buddy->online(1);
17 }
18 $self->SUPER::source();
19 }
20  
21  
22 sub from
23 {
24 my $self = shift;
25 # $self->{from} = shift if @_;
26 # return $self->{from};
27 $self->_get_by_name('BUDDY_ID');
28 }
29  
30  
31 sub to_string
32 {
33 my $self = shift;
34 sprintf "%s: goes online", $self->{sender};
35 }
36  
37 1;
38 __END__