Use `all?`. #160

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+1 −3
Split
@@ -97,9 +97,7 @@ def matches?(subject)
def allows_blank_value?
if @options.key?(:allow_blank)
blank_values = ['', ' ', "\n", "\r", "\t", "\f"]
- @options[:allow_blank] == blank_values.inject(true) do |memo, value|
- memo &&= allows_value_of(value)
- end
+ @options[:allow_blank] == blank_values.all? { |value| allows_value_of(value) }
else
true
end