Skip to content

Commit

Permalink
Filter also classes that are abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Feb 21, 2021
1 parent e14bdc5 commit ffc01af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/washout_builder/document/shared_complex_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ module SharedComplexType
# @param [Array<Class>] array The array of classes that should be fitered from the ancestors if they are present
# @return [Array<Class>] The classes from which the class given as first argument inherits from but filtering the classes passed as second argument
def get_complex_type_ancestors(class_name, array)
(class_name.ancestors - class_name.included_modules).delete_if { |x| x.to_s.downcase == class_name.to_s.downcase || array.include?(x.to_s) }
(class_name.ancestors - class_name.included_modules).delete_if do |x|
x.to_s.downcase == class_name.to_s.downcase ||
array.include?(x.to_s) ||
(x.respond_to?(:abstract_class) && x.abstract_class)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/washout_builder/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module VERSION
# the minor version of the gem
MINOR = 0
# the tiny version of the gem
TINY = 4
TINY = 5
# if the version should be a prerelease
PRE = nil

Expand Down

0 comments on commit ffc01af

Please sign in to comment.