def main_method
new_array = []
some_array.each do |foo|
if (method_01? foo) || (method_02? foo) || (method_03? foo) || (method_04? foo) || (method_05? foo)
else
new_array << foo
end
end
end
Is there a better way to write the above code without or (||) and without elsif conditions?
Is looping thru a hash appropriate for such refactoring?
fooand adds back tonew_arrayif none of the methods match then the element is added the to thenew_array- Баста