Skip to content

Commit

Permalink
Use all?.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Sep 28, 2012
1 parent dc5daca commit 7f208e7
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit 7f208e7

Please sign in to comment.