| 1 | package Thrift::IDL::Field; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Thrift::IDL::Field | ||
| 6 | |||
| 7 | =head1 DESCRIPTION | ||
| 8 | |||
| 9 | Inherits from L<Thrift::IDL::Base> | ||
| 10 | |||
| 11 | =cut | ||
| 12 | |||
| 13 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 4 | ▶ | use base qw(Thrift::IDL::Base); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 4 | __PACKAGE__->mk_accessors(qw(id optional type name default_value)); | |
| 17 | |||
| 18 | =head1 METHODS | ||
| 19 | |||
| 20 | =head2 id | ||
| 21 | |||
| 22 | =head2 optional | ||
| 23 | |||
| 24 | =head2 type | ||
| 25 | |||
| 26 | =head2 name | ||
| 27 | |||
| 28 | =head2 default_value | ||
| 29 | |||
| 30 | Scalar accessors | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | 4 | ▶ | sub to_str { |
|
Subroutine
to_str: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 35 | 4 | my ($self) = @_; | |
| 36 | |||
| 37 | return sprintf '%s (%s)', | ||
| 38 | $self->name, | ||
| 39 | join(', ', | ||
| 40 | 8 | map { $_ .': '. $self->$_ } | |
| 41 | 4 | grep { defined $self->$_ } | |
| 42 | qw(id type optional default_value) | ||
| 43 | ); | ||
| 44 | } | ||
| 45 | |||
| 46 | 4 | 1; | |