Skip to content

Commit

Permalink
Add missing helper sub that I forgot to implement in the role composer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Dec 7, 2009
1 parent 2edef04 commit fcdef68
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/metamodel/RoleToClassApplier.nqp
Expand Up @@ -29,6 +29,14 @@ sub has_method($target, $name, $local) {
return 0;
}

sub has_attribute($target, $name) {
my @attributes := $target.attributes($target, :local(1));
for @attributes {
if $_.name eq $name { return 1; }
}
return 0;
}

method apply($target, @composees) {
# If we have many things to compose, then get them into a single helper
# role first.
Expand Down

0 comments on commit fcdef68

Please sign in to comment.