| 1 | # You may distribute under the terms of either the GNU General Public License | ||
| 2 | # or the Artistic License (the same terms as Perl itself) | ||
| 3 | # | ||
| 4 | # (C) Paul Evans, 2012-2024 -- leonerd@leonerd.org.uk | ||
| 5 | |||
| 6 | 15 | ▶ | use v5.26; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 15 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 15 | ▶ | use Object::Pad 0.800; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | package Tangence::Meta::Field 0.33; | ||
| 11 | class Tangence::Meta::Field :strict(params); | ||
| 12 | |||
| 13 | 15 | =head1 NAME | |
| 14 | |||
| 15 | C<Tangence::Meta::Field> - structure representing one C<Tangence> structure | ||
| 16 | field | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | This data structure object stores information about one field of a L<Tangence> | ||
| 21 | structure. Once constructed, such objects are immutable. | ||
| 22 | |||
| 23 | =cut | ||
| 24 | |||
| 25 | =head1 CONSTRUCTOR | ||
| 26 | |||
| 27 | =cut | ||
| 28 | |||
| 29 | =head2 new | ||
| 30 | |||
| 31 | $field = Tangence::Meta::Field->new( %args ) | ||
| 32 | |||
| 33 | Returns a new instance initialised by the given fields. | ||
| 34 | |||
| 35 | =over 8 | ||
| 36 | |||
| 37 | =item name => STRING | ||
| 38 | |||
| 39 | Name of the field | ||
| 40 | |||
| 41 | =item type => STRING | ||
| 42 | |||
| 43 | Type of the field as a L<Tangence::Meta::Type> reference | ||
| 44 | |||
| 45 | =back | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | 1035 | ▶ | field $name :param :reader; |
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 50 | 843 | ▶ | field $type :param :reader; |
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
documented
| |||
| 51 | |||
| 52 | =head1 ACCESSORS | ||
| 53 | |||
| 54 | =cut | ||
| 55 | |||
| 56 | =head2 name | ||
| 57 | |||
| 58 | $name = $field->name | ||
| 59 | |||
| 60 | Returns the name of the field | ||
| 61 | |||
| 62 | =cut | ||
| 63 | |||
| 64 | =head2 type | ||
| 65 | |||
| 66 | $type = $field->type | ||
| 67 | |||
| 68 | Return the type as a L<Tangence::Meta::Type> reference. | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | =head1 AUTHOR | ||
| 73 | |||
| 74 | Paul Evans <leonerd@leonerd.org.uk> | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||
| 78 | 15 | 0x55AA; | |