1MooseX::Has::Sugar::MinUismearl(C3o)ntributed Perl DocumMeonotsaetXi:o:nHas::Sugar::Minimal(3)
2
3
4
6 MooseX::Has::Sugar::Minimal - Less Sugary Syntax for moose 'has' fields
7
9 version 1.000006
10
12 This is a legacy variant of Sugar which only exports "ro" and "rw"
13 functions, the way MooseX::Has::Sugar used to with ":is";
14
15 use MooseX::Types::Moose qw( Str );
16 use MooseX::Has::Sugar::Minimal;
17
18 has foo => (
19 isa => Str,
20 is => ro,
21 required => 1,
22 );
23 has bar => (
24 isa => Str,
25 is => rw,
26 lazy_build => 1,
27 );
28
29 All functions are exported by The Sub::Exporter Module.
30
32 ":default"
33 Exports ":is"
34
35 ":is"
36 Exports "bare", "ro", "rw"
37
39 "bare"
40 returns "('bare')"
41
42 "ro"
43 returns "('ro')"
44
45 "rw"
46 returns "('rw')"
47
49 MooseX::Has::Sugar
50 MooseX::Has::Sugar::Saccharin
51 This module is not intended to be used in conjunction with
52 ::Sugar or ::Sugar::Saccharin.
53
54 We all export "ro" and "rw" in different ways.
55
56 If you do however want to use them in conjunction, specific imports
57 must
58 be done on MooseX::Has::Sugar's side to stop it exporting different
59 ro/rw. Any of the below should be fine.
60
61 use MooseX::Has::Sugar::Minimal;
62 use MooseX::Has::Sugar qw( :attrs );
63
64 has foo =>( is => rw , lazy_build );
65
66 use MooseX::Has::Sugar::Minimal;
67 use MooseX::Has::Sugar qw( lazy_build );
68
69 has foo =>( is => rw , lazy_build );
70
72 Kent Fredric <kentnl@cpan.org>
73
75 This software is copyright (c) 2017 by Kent Fredric
76 <kentfredric@gmail.com>.
77
78 This is free software; you can redistribute it and/or modify it under
79 the same terms as the Perl 5 programming language system itself.
80
81
82
83perl v5.30.0 2019-07-26 MooseX::Has::Sugar::Minimal(3)