| 1 | package XML::NewsML_G2::Location; | ||
| 2 | |||
| 3 | 19 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 19 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 19 | with 'XML::NewsML_G2::Role::HasQCode'; | |
| 7 | |||
| 8 | 19 | has 'relevance', isa => 'Int', is => 'ro'; | |
| 9 | 19 | has 'parent', isa => __PACKAGE__, is => 'rw'; | |
| 10 | 19 | has 'direct', isa => 'Bool', is => 'rw', default => ''; | |
| 11 | 19 | has 'iso_code', isa => 'Str', is => 'rw'; | |
| 12 | 19 | has 'longitude', isa => 'Num', is => 'rw'; | |
| 13 | 19 | has 'latitude', isa => 'Num', is => 'rw'; | |
| 14 | |||
| 15 | 19 | __PACKAGE__->meta->make_immutable; | |
| 16 | |||
| 17 | 19 | 1; | |
| 18 | __END__ | ||
| 19 | |||
| 20 | =head1 NAME | ||
| 21 | |||
| 22 | XML::NewsML_G2::Location - a location (city, region, country, ...) | ||
| 23 | |||
| 24 | =head1 SYNOPSIS | ||
| 25 | |||
| 26 | my $at = XML::NewsML_G2::Location->new | ||
| 27 | (name => 'Austria', qcode => 'at', relevance => 90, iso_code => 'AT'); | ||
| 28 | |||
| 29 | my $vie = XML::NewsML_G2::Location->new | ||
| 30 | (name => 'Vienna', qcode => 'vie', relevance => 100, parent => $at); | ||
| 31 | |||
| 32 | =head1 ATTRIBUTES | ||
| 33 | |||
| 34 | =over 4 | ||
| 35 | |||
| 36 | =item relevance | ||
| 37 | |||
| 38 | Value (0..100) specifying how relevant the location is for the news item | ||
| 39 | |||
| 40 | =item parent | ||
| 41 | |||
| 42 | points to the broader location (e.g., the city's country) | ||
| 43 | |||
| 44 | =item direct | ||
| 45 | |||
| 46 | whether the location has been manually specified by the editor | ||
| 47 | |||
| 48 | =item iso_code | ||
| 49 | |||
| 50 | for countries, the code in the ISO 3166-1a2 vocabulary - see | ||
| 51 | L<http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements.htm> | ||
| 52 | for a reference | ||
| 53 | |||
| 54 | =back | ||
| 55 | |||
| 56 | =head1 AUTHOR | ||
| 57 | |||
| 58 | Philipp Gortan C<< <philipp.gortan@apa.at> >> | ||
| 59 | |||
| 60 | =head1 LICENCE AND COPYRIGHT | ||
| 61 | |||
| 62 | Copyright (c) 2013-2014, APA-IT. All rights reserved. | ||
| 63 | |||
| 64 | See L<XML::NewsML_G2> for the license. | ||