12 return bless({ ref($_[0]) eq 'HASH' ? %{$_[0]} : @_ }, $class);
13 $NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class};
15 ? bless({ ref($_[0]) eq 'HASH' ? %{$_[0]} : @_ }, $class)
17 my $proto = ref($_[0]) eq 'HASH' ? $_[0] : { @_ };
18 bless({ %$proto }, $class)->BUILDALL($proto);
22 # Inlined into Method::Generate::Constructor::_generate_args() - keep in sync
25 if ( scalar @_ == 1 ) {
26 unless ( defined $_[0] && ref $_[0] eq 'HASH' ) {
27 die "Single parameters to new() must be a HASH ref"
28 ." data => ". $_[0] ."\n";
30 return { %{ $_[0] } };
33 die "The new() method for $class expects a hash reference or a key/value list."
34 . " You passed an odd number of arguments\n";
43 $self->${\(($BUILD_MAKER ||= do {
44 require Method::Generate::BuildAll;
45 Method::Generate::BuildAll->new
46 })->generate_method(ref($self)))}(@_);
52 return unless $self->can('DEMOLISH'); # short circuit
62 $self->DEMOLISHALL($Moo::_Utils::_in_global_destruction);
68 die $e if $e; # rethrow
73 $self->${\(($DEMOLISH_MAKER ||= do {
74 require Method::Generate::DemolishAll;
75 Method::Generate::DemolishAll->new
76 })->generate_method(ref($self)))}(@_);
81 { no warnings 'redefine'; *does = \&Role::Tiny::does_role }
82 goto &Role::Tiny::does_role;