source: branches/2015/dev_r5021_UKMO1_CICE_coupling/NEMOGCM/EXTERNAL/fcm/lib/Fcm/Keyword/Entry.pm @ 5445

Last change on this file since 5445 was 5445, checked in by davestorkey, 5 years ago

Clear SVN keywords from 2015/dev_r5021_UKMO1_CICE_coupling branch.

File size: 1.6 KB
Line 
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# ------------------------------------------------------------------------------
6use strict;
7use warnings;
8
9package Fcm::Keyword::Entry;
10
11sub new {
12    my ($class, $args_ref) = @_;
13    if (!$args_ref) {
14        $args_ref = {};
15    }
16    return bless({%{$args_ref}}, $class);
17}
18
19################################################################################
20### Methods: get_*
21for my $name (
22    # Returns the key of this entry
23    'key',
24    # Returns the value of this entry
25    'value',
26) {
27    no strict qw{refs};
28    my $getter = "get_$name";
29    *$getter = sub {
30        my ($self) = @_;
31        return $self->{$name};
32    }
33}
34
351;
36__END__
37
38=head1 NAME
39
40Fcm::Keyword::Entry
41
42=head1 SYNOPSIS
43
44    use Fcm::Keyword::Entry;
45
46    $entry = Fcm::Keyword::Entry->new({key => $key, value => $value});
47    $key = $entry->get_key();
48    $value = $entry->get_value();
49
50=head1 DESCRIPTION
51
52An object of this class represents a FCM keyword entry.
53
54=head1 METHODS
55
56=over 4
57
58=item C<new({key =E<gt> $key, value =E<gt> $value})>
59
60Constructor.
61
62=item get_key()
63
64Returns the key of this keyword entry.
65
66=item get_value()
67
68Returns the value of this keyword entry.
69
70=back
71
72Simple formatter for displaying an entry.
73
74=head1 SEE ALSO
75
76L<Fcm::Keyword|Fcm::Keyword>,
77L<Fcm::Keyword::Entries|Fcm::Keyword::Entries>
78
79=head1 COPYRIGHT
80
81E<169> Crown copyright Met Office. All rights reserved.
82
83=cut
Note: See TracBrowser for help on using the repository browser.