-
-
Save anonymous/a58e4878c1d545f49575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
submethod BUILD (*%data){ | |
for self.^attributes.grep($_.name.substr(2) ~~ %data.keys) -> $attr { | |
%data{$attr.name.substr(2)}.say; | |
if $attr.type ~~ Resource { | |
$attr.set_value($attr.type.new(:id(%data{$attr.name.substr(2)}))); | |
} else { | |
$attr.set_value(%data{$attr.name.substr(2)}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment