Skip to content
Browse files

Push type check down into a method.

  • Loading branch information...
1 parent cfe4d5e commit 7bc67aab0a344d55b67b6a26a3713da1bc93df0b @xaviershay xaviershay committed Oct 21, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/cane/threshold_check.rb
View
3 lib/cane/threshold_check.rb
@@ -20,7 +20,7 @@ def violations
value = normalized_limit(file)
limit = normalized_limit(threshold)
- if limit.is_a? UnavailableValue
+ if !limit.real?
{
description: 'Quality threshold could not be read',
label: "%s is not a number or a file" % [
@@ -63,6 +63,7 @@ def thresholds
class UnavailableValue
def >=(_); false end
def to_s; 'unavailable' end
+ def real?; false; end
end
end

0 comments on commit 7bc67aa

Please sign in to comment.
Something went wrong with that request. Please try again.