X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FFunction%2FParameters%2FInfo.pm;h=ffec6076f827876cf54814897fafa9870d80542a;hb=d72d56ce74efe8558da8154d85aea834ff87dfc6;hp=fd8a0ecad597f39563d7cef6de9f8617fbb7fa85;hpb=8c4ca5488efd58ba287abb22a5b24aea9cb4f8f6;p=p5sagit%2FFunction-Parameters.git diff --git a/lib/Function/Parameters/Info.pm b/lib/Function/Parameters/Info.pm index fd8a0ec..ffec607 100644 --- a/lib/Function/Parameters/Info.pm +++ b/lib/Function/Parameters/Info.pm @@ -1,21 +1,18 @@ package Function::Parameters::Info; use v5.14.0; - use warnings; -our $VERSION = '0.02'; +our $VERSION = '0.04'; # If Moo isn't loaded yet but Moose is, avoid pulling in Moo and fall back to Moose -my ($Moo, $meta_make_immutable); +my $Moo; BEGIN { if ($INC{'Moose.pm'} && !$INC{'Moo.pm'}) { $Moo = 'Moose'; - $meta_make_immutable = sub { $_[0]->meta->make_immutable }; } else { require Moo; $Moo = 'Moo'; - $meta_make_immutable = sub {}; } $Moo->import; } @@ -26,12 +23,12 @@ BEGIN { BEGIN { $Moo->import; } use overload fallback => 1, - '""' => sub { $_[0]->name }, + '""' => sub { $_[0]->name }, ; has $_ => (is => 'ro') for qw(name type); - __PACKAGE__->$meta_make_immutable; + __PACKAGE__->meta->make_immutable; } my @pn_ro = glob '{positional,named}_{required,optional}'; @@ -65,7 +62,7 @@ sub args_max { $r } -__PACKAGE__->$meta_make_immutable; +__PACKAGE__->meta->make_immutable; 'ok' @@ -173,7 +170,7 @@ Lukas Mai, C<< >> =head1 COPYRIGHT & LICENSE -Copyright 2012 Lukas Mai. +Copyright 2013 Lukas Mai. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published