GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MooX::Thunking(3) User Contributed Perl Documentation MooX::Thunking(3)

MooX::Thunking - Allow Moo attributes to be "thunked"

  package Thunking;
  use Moo;
  use MooX::Thunking;
  use Types::TypeTiny -all;
  use Types::Standard -all;
  has children => (
    is => 'thunked',
    isa => ArrayRef[InstanceOf['Thunking']],
    required => 1,
  );

  package main;
  my $obj;
  $obj = Thunking->new(children => sub { [$obj] });

This is a Moo extension. It allows another value for the "is" parameter to "has" in Moo: "thunked". If used, this will allow you to transparently provide either a real value for the attribute, or a "CodeLike" in Types::TypeTiny that when called will return such a real value.

Note that in earlier versions of this module (up to 0.06), any "isa" had to pass a "CodeLike". This is now taken care of by this module. It will continue to do the right thing if no "isa" is supplied.

Ed J

The same terms as Perl itself.
2018-02-23 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.