File: README.md

package info (click to toggle)
libmoox-buildargs-perl 0.08-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: perl: 300; makefile: 2
file content (63 lines) | stat: -rw-r--r-- 1,613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# NAME

MooX::BuildArgs - Save instantiation arguments for later use.

# SYNOPSIS

```perl
package Foo;
use Moo;
with 'MooX::BuildArgs';
has bar => (is => 'ro');

my $foo = Foo->new( bar => 32 );
print $foo->build_args->{bar}; # 32
```

# DESCRIPTION

It is often useful to be able to access the arguments that were
used to create an object in their unadulterated form, before any
coercions or init\_args have changed them.  This [Moo](https://metacpan.org/pod/Moo) role
provides the arguments via the ["build\_args"](#build_args) attribute.

Note that no attempt is made to weaken the args.  So, if you use
this module and you have attributes with `weak_ref` set the
references will not be weakened within ["build\_args"](#build_args).

# ATTRIBUTES

## build\_args

```perl
my $args_hashref = $object->build_args();
```

Returns a hashref containing the captured arguments.

# SEE ALSO

- [MooX::BuildArgsHooks](https://metacpan.org/pod/MooX::BuildArgsHooks)
- [MooX::MethodProxyArgs](https://metacpan.org/pod/MooX::MethodProxyArgs)
- [MooX::Rebuild](https://metacpan.org/pod/MooX::Rebuild)
- [MooX::SingleArg](https://metacpan.org/pod/MooX::SingleArg)

# SUPPORT

Please submit bugs and feature requests to the
MooX-BuildArgs GitHub issue tracker:

[https://github.com/bluefeet/MooX-BuildArgs/issues](https://github.com/bluefeet/MooX-BuildArgs/issues)

# AUTHORS

```
Aran Clary Deltac <bluefeet@gmail.com>
Peter Pentchev <roam@ringlet.net>
Mohammad S Anwar <mohammad.anwar@yahoo.com>
```

# LICENSE

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.