[1980] | 1 | # ------------------------------------------------------------------------------ |
---|
| 2 | # (C) Crown copyright Met Office. All rights reserved. |
---|
| 3 | # For further details please refer to the file COPYRIGHT.txt |
---|
| 4 | # which you should have received as part of this distribution. |
---|
| 5 | # ------------------------------------------------------------------------------ |
---|
| 6 | use strict; |
---|
| 7 | use warnings; |
---|
| 8 | |
---|
| 9 | package Fcm::Keyword::Formatter::Entry::Location; |
---|
| 10 | use base qw{Fcm::Keyword::Formatter::Entry}; |
---|
| 11 | |
---|
| 12 | use Fcm::Config; |
---|
| 13 | use Fcm::Keyword::Formatter::Entries; |
---|
| 14 | |
---|
| 15 | ################################################################################ |
---|
| 16 | # Formats a keyword entry |
---|
| 17 | sub format { |
---|
| 18 | my ($self, $entry) = @_; |
---|
| 19 | my $return = $self->SUPER::format($entry); |
---|
| 20 | for my $implied_entry (@{$entry->get_implied_entry_list()}) { |
---|
| 21 | $return .= $self->SUPER::format($implied_entry); |
---|
| 22 | } |
---|
| 23 | if (@{$entry->get_revision_entries()->get_all_entries()}) { |
---|
| 24 | my $formatter = Fcm::Keyword::Formatter::Entries->new(); |
---|
| 25 | $return .= "\n[revision keyword]\n"; |
---|
| 26 | $return .= $formatter->format($entry->get_revision_entries()); |
---|
| 27 | } |
---|
| 28 | return $return; |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | 1; |
---|
| 32 | __END__ |
---|
| 33 | |
---|
| 34 | =head1 NAME |
---|
| 35 | |
---|
| 36 | Fcm::Keyword::Formatter::Entry::Location |
---|
| 37 | |
---|
| 38 | =head1 SYNOPSIS |
---|
| 39 | |
---|
| 40 | use Fcm::Keyword::Formatter::Entry::Location; |
---|
| 41 | $formatter = Fcm::Keyword::Formatter::Entry::Location->new(); |
---|
| 42 | print($formatter->format($entry)); |
---|
| 43 | |
---|
| 44 | =head1 DESCRIPTION |
---|
| 45 | |
---|
| 46 | An object of this class is used to format the detail in a location keyword entry. |
---|
| 47 | |
---|
| 48 | =head1 METHODS |
---|
| 49 | |
---|
| 50 | =over 4 |
---|
| 51 | |
---|
| 52 | =item new() |
---|
| 53 | |
---|
| 54 | Constructor. |
---|
| 55 | |
---|
| 56 | =item format($entry) |
---|
| 57 | |
---|
| 58 | Returns a string representation of $entry. |
---|
| 59 | |
---|
| 60 | =back |
---|
| 61 | |
---|
| 62 | =head1 SEE ALSO |
---|
| 63 | |
---|
| 64 | L<Fcm::Keyword::Entry|Fcm::Keyword::Entry>, |
---|
| 65 | L<Fcm::Keyword::Formatter::Entry|Fcm::Keyword::Formatter::Entry>, |
---|
| 66 | L<Fcm::Keyword::Formatter::Entries|Fcm::Keyword::Formatter::Entries> |
---|
| 67 | |
---|
| 68 | =head1 COPYRIGHT |
---|
| 69 | |
---|
| 70 | E<169> Crown copyright Met Office. All rights reserved. |
---|
| 71 | |
---|
| 72 | =cut |
---|