- or download this
use v5.12;
use strict;
...
my $inflated = MyClassA->new( JSON->new->decode($json) );
say $inflated->getClassB->getName;
- or download this
isa => InstanceOf->of('MyClassB')->plus_constructors( Has
+hRef, 'new' ),
coerce => 1,
- or download this
if ( exists $extras{MY_CLASS_B} and ref $extras{MY_CLASS_B} eq 'HA
+SH' ) {
$extras{MY_CLASS_B} = MyClassB->new( %{ $extras{MY_CLASS_B} }
+);
}