about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-12 00:43:36 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-12 00:44:27 -0800
commit6369300ca4171acf6848e2f63b24aa5278c42c1b (patch)
tree41204aa7fd69093a783794a937cba01253f84ec5
parenta063217a2198769edcc287e662e5c4691c0ae4d0 (diff)
downloadupr-6369300ca4171acf6848e2f63b24aa5278c42c1b.tar.gz
status: add error? method
We'll define setting seen == -1 to be an error since
it's impossible to see -1 bytes.
-rw-r--r--lib/upr/status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/upr/status.rb b/lib/upr/status.rb
index b84357e..e3f4024 100644
--- a/lib/upr/status.rb
+++ b/lib/upr/status.rb
@@ -2,5 +2,9 @@ module Upr
 
   # this is what we store in the Moneta-backed monitor
   class Status < Struct.new(:seen, :length)
+
+    def error?
+      seen == -1
+    end
   end
 end