source:
branches/UKMO/r6232_tracer_advection/NEMOGCM/EXTERNAL/fcm/lib/Fcm/Keyword/Formatter/Entry.pm
@
9295
Last change on this file since 9295 was 9295, checked in by jcastill, 6 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[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; | |
10 | ||
11 | ################################################################################ | |
12 | # Constructor | |
13 | sub new { | |
14 | my ($class) = @_; | |
15 | return bless(\do{my $annon_scalar}, $class); | |
16 | } | |
17 | ||
18 | ################################################################################ | |
19 | # Formats a keyword entry | |
20 | sub format { | |
21 | my ($self, $entry) = @_; | |
22 | return sprintf("%s = %s\n", $entry->get_key(), $entry->get_value()); | |
23 | } | |
24 | ||
25 | 1; | |
26 | __END__ | |
27 | ||
28 | =head1 NAME | |
29 | ||
30 | Fcm::Keyword::Formatter::Entry | |
31 | ||
32 | =head1 SYNOPSIS | |
33 | ||
34 | use Fcm::Keyword::Formatter::Entry; | |
35 | $formatter = Fcm::Keyword::Formatter::Entry->new(); | |
36 | print($formatter->format($entry)); | |
37 | ||
38 | =head1 DESCRIPTION | |
39 | ||
40 | An object of this class is used to format a keyword entry. | |
41 | ||
42 | =head1 METHODS | |
43 | ||
44 | =over 4 | |
45 | ||
46 | =item new() | |
47 | ||
48 | Constructor. | |
49 | ||
50 | =item format($entry) | |
51 | ||
52 | Returns a simple string representation of $entry. | |
53 | ||
54 | =back | |
55 | ||
56 | =head1 SEE ALSO | |
57 | ||
58 | L<Fcm::Keyword::Entry|Fcm::Keyword::Entry> | |
59 | ||
60 | =head1 COPYRIGHT | |
61 | ||
62 | E<169> Crown copyright Met Office. All rights reserved. | |
63 | ||
64 | =cut |
Note: See TracBrowser
for help on using the repository browser.