summaryrefslogtreecommitdiff
path: root/lib/Tangence/Meta/Field.pm
blob: 2572c456bf81976fbe99eef4b4217f97c20def53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#  You may distribute under the terms of either the GNU General Public License
#  or the Artistic License (the same terms as Perl itself)
#
#  (C) Paul Evans, 2012-2017 -- leonerd@leonerd.org.uk

package Tangence::Meta::Field;

use strict;
use warnings;

our $VERSION = '0.25';

=head1 NAME

C<Tangence::Meta::Field> - structure representing one C<Tangence> structure
field

=head1 DESCRIPTION

This data structure object stores information about one field of a L<Tangence>
structure. Once constructed, such objects are immutable.

=cut

=head1 CONSTRUCTOR

=cut

=head2 new

   $field = Tangence::Meta::Field->new( %args )

Returns a new instance initialised by the given fields.

=over 8

=item name => STRING

Name of the field

=item type => STRING

Type of the field as a L<Tangence::Meta::Type> reference

=back

=cut

sub new
{
   my $class = shift;
   my %args = @_;
   bless \%args, $class;
}

=head1 ACCESSORS

=cut

=head2 name

   $name = $field->name

Returns the name of the field

=cut

sub name
{
   my $self = shift;
   return $self->{name};
}

=head2 type

   $type = $field->type

Return the type as a L<Tangence::Meta::Type> reference.

=cut

sub type
{
   my $self = shift;
   return $self->{type};
}

=head1 AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

=cut

0x55AA;