Skip to content

Commit

Permalink
Extended exclusions to all inherited classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadeweka committed Nov 9, 2021
1 parent 29c731d commit 42d48c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ The term 'anyoli' means 'green' in the Maasai language, thus naming 'anyolite'.
#### Usability

* [X] Anyolite now respects exclusions of `dup` and `clone`
* [X] Exclude annotations on `Object` will exclude these methods from all classes
* [X] Instance method exclude annotations on classes or modules will exclude them from all inheriting classes
* [X] Include annotations can reverse global exclusions

#### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion src/macros/WrapAll.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Anyolite
{% how_many_times_wrapped = {} of String => UInt32 %}

{% for method, index in method_source.resolve.methods %}
{% all_annotations_exclude_im = crystal_class.resolve.annotations(Anyolite::ExcludeInstanceMethod) + method_source.resolve.annotations(Anyolite::ExcludeInstanceMethod) + crystal_class.resolve.ancestors[-1].resolve.annotations(Anyolite::ExcludeInstanceMethod) %}
{% all_annotations_exclude_im = crystal_class.resolve.annotations(Anyolite::ExcludeInstanceMethod) + method_source.resolve.annotations(Anyolite::ExcludeInstanceMethod) + crystal_class.resolve.ancestors.map {|ancestor| ancestor.resolve.annotations(Anyolite::ExcludeInstanceMethod)} %}
{% annotation_exclude_im = all_annotations_exclude_im.find { |element| element[0].id.stringify == method.name.stringify } %}

{% all_annotations_include_im = crystal_class.resolve.annotations(Anyolite::IncludeInstanceMethod) + method_source.resolve.annotations(Anyolite::IncludeInstanceMethod) %}
Expand Down

0 comments on commit 42d48c3

Please sign in to comment.