• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/MooX/H23-Feb-2018-9341

t/H23-Feb-2018-11086

xt/H23-Feb-2018-5838

ChangesH A D23-Feb-2018639 2618

MANIFESTH A D23-Feb-2018352 1514

META.jsonH A D23-Feb-20181.5 KiB6867

META.ymlH A D23-Feb-2018778 3231

Makefile.PLH A D06-Sep-20171.2 KiB4846

README.mdH A D06-Sep-2017884 3726

README.md

1# NAME
2
3MooX::Thunking - Allow Moo attributes to be "thunked"
4
5# SYNOPSIS
6
7    package Thunking;
8    use Moo;
9    use MooX::Thunking;
10    use Types::TypeTiny -all;
11    use Types::Standard -all;
12    has children => (
13      is => 'thunked',
14      isa => CodeLike | ArrayRef[InstanceOf['Thunking']],
15      required => 1,
16    );
17
18    package main;
19    my $obj;
20    $obj = Thunking->new(children => sub { [$obj] });
21
22# DESCRIPTION
23
24This is a [Moo](https://metacpan.org/pod/Moo) extension. It allows another value for the `is`
25parameter to ["has" in Moo](https://metacpan.org/pod/Moo#has): "thunked". If used, this will allow you to
26transparently provide either a real value for the attribute, or a
27["CodeLike" in Types::TypeTiny](https://metacpan.org/pod/Types::TypeTiny#CodeLike) that when called will return such a real
28value.
29
30# AUTHOR
31
32Ed J
33
34# LICENCE
35
36The same terms as Perl itself.
37