| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Google::Voice::SMS::Message; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
33
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
25
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Mojo::ByteStream; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
45
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use Mojo::Base -base; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
8
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->attr([qw/ text time inbound outbound xml rnr_se ua /]); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
|
13
|
0
|
|
|
0
|
1
|
|
my $self = bless {}, shift; |
|
14
|
0
|
|
|
|
|
|
my $xml = shift; |
|
15
|
0
|
|
|
|
|
|
my $meta = shift; |
|
16
|
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
$self->rnr_se(shift); |
|
18
|
0
|
|
|
|
|
|
$self->ua(shift); |
|
19
|
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $from = |
|
21
|
|
|
|
|
|
|
Mojo::ByteStream->new($xml->at('.gc-message-sms-from')->text)->trim; |
|
22
|
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $time = |
|
24
|
|
|
|
|
|
|
Mojo::ByteStream->new($xml->at('.gc-message-sms-time')->text)->trim; |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$self->xml($xml); |
|
27
|
0
|
|
|
|
|
|
$self->text($xml->at('.gc-message-sms-text')->text); |
|
28
|
0
|
|
|
|
|
|
$self->time($time); |
|
29
|
0
|
|
|
|
|
|
$self->inbound($from eq 'Me:'); |
|
30
|
0
|
|
|
|
|
|
$self->outbound($from ne 'Me:'); |
|
31
|
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return $self; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Google::Voice::SMS::Message |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
One message in an sms conversation |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 USAGE |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
print "Inbound message" if $sms_message->inbound; |
|
48
|
|
|
|
|
|
|
print $sms_message->text; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 text |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Text content of message |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 inbound |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
True/false |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 outbound |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
True/false |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 xml |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Raw xml |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 METHODS |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 new |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |