line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use Moo; |
2
|
1
|
|
|
1
|
|
6
|
use NewsExtractor::Types qw< Text Text1K >; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
3
|
1
|
|
|
1
|
|
245
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
has headline => ( required => 1, is => 'ro', isa => Text1K ); |
5
|
|
|
|
|
|
|
has article_body => ( required => 1, is => 'ro', isa => Text ); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has dateline => ( predicate => 1, is => 'ro', isa => Text1K ); |
8
|
|
|
|
|
|
|
has journalist => ( predicate => 1, is => 'ro', isa => Text1K ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my ($self) = @_; |
11
|
|
|
|
|
|
|
return { |
12
|
0
|
|
|
0
|
0
|
|
headline => $self->headline, |
13
|
|
|
|
|
|
|
article_body => $self->article_body, |
14
|
0
|
|
|
|
|
|
dateline => $self->dateline, |
15
|
|
|
|
|
|
|
journalist => $self->journalist, |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 Name |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
NewsExtractor::Article - A data class for containing news article. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 Description |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This is a data class that contains an news article extracted from some web sites. |
29
|
|
|
|
|
|
|
The instances of this data class has these attributes: |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=over 4 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=item headline |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Mandatory. Str. Refer to the headline of a news article. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item article_body |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Mandatory. Str. Refer to the body of a news article. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item dateline |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Optional. One must check the presense of this attribute with C<has_dateline> |
44
|
|
|
|
|
|
|
method before taking the value of it. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item journalist |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Optional. One must check the presense of this attribute with C<has_journalist> |
49
|
|
|
|
|
|
|
method before taking the value of it. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=back |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |