Package Info

perl-MooseX-OneArgNew


Teach ->new to accept single, non-hashref arguments


Unspecified

MooseX::OneArgNew lets your constructor take a single argument, which will be translated into the value for a one-entry hashref. It is a parameterized role|MooseX::Role::Parameterized with three parameters:

  • type

The Moose type that the single argument must be for the one-arg form to work. This should be an existing type, and may be either a string type or a MooseX::Type.

  • init_arg

This is the string that will be used as the key for the hashref constructed from the one-arg call to new.

  • coerce

If true, a single argument to new will be coerced into the expected type if possible. Keep in mind that if there are no coercions for the type, this will be an error, and that if a coercion from HashRef exists, you might be getting yourself into a weird situation.


License: Artistic-1.0 OR GPL-1.0-or-later
URL: https://metacpan.org/release/MooseX-OneArgNew

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.007-bp156.2.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.007-bp155.1.4 info GA Release 2023-05-17 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.005-bp154.1.19 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.005-bp153.1.13 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.005-bp152.3.13 info GA Release 2020-04-17 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.005-bp151.3.1 info GA Release 2019-07-16 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.005-bp151.2.11 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew
0.005-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • perl-MooseX-OneArgNew