use utf8;

package [% class_name %];

# ABSTRACT: [% abstract %]

use v5.14;
use Moo;

[% IF parents.size -%]
extends qw/[% FOREACH parent IN parents.sort %] [% parent %][% END %] /;
[% END -%]

[% IF roles.size -%]
with qw/[% FOREACH role IN roles.sort %] [% role %][% END %] /;
[% END -%]

use MooX::JSON_LD '[% label %]';
use Ref::Util qw/ is_plain_hashref /;
# RECOMMEND PREREQ: Ref::Util::XS

use namespace::autoclean;

our $VERSION = '[% version %]';

=encoding utf8

=head1 DESCRIPTION

[% description %]

[% IF attributes.size %]
=head1 ATTRIBUTES

[% FOREACH name IN attributes.keys.sort -%]

=head2 C<[% name %]>

[% IF name != attributes.$name.label %]C<[% attributes.$name.label %]>[% END %]

[% attributes.$name.description -%]

[% IF attributes.$name.types -%]
A [% name %] should be one of the following types:

=over
[% FOREACH type IN attributes.$name.types.sort %]
=item C<[% type %]>
[% END -%]

=back
[% END -%]

=head2 C<_has_[% name %]>

A predicate for the L</[% name %]> attribute.

=cut

has [% name %] => (
    is        => 'rw',
    predicate => '_has_[% name %]',
    json_ld   => '[% attributes.$name.label %]',
);

[% END %]
[% ELSE %]
=cut
[% END %]

=head1 SEE ALSO

[% FOREACH role in roles.sort %]
L<[% role %]>
[% END -%]

[% FOREACH parent in parents.sort %]
L<[% parent %]>
[% END -%]

=cut

1;