[svn] commit: r315 - /branches/parkinglot/src/lib/cc/ruby/lib/cc/message.rb

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Nov 20 14:14:20 UTC 2009


Author: jelte
Date: Fri Nov 20 14:14:19 2009
New Revision: 315

Log:
this seems safer, when TrueClass/FalseClass

Modified:
    branches/parkinglot/src/lib/cc/ruby/lib/cc/message.rb

Modified: branches/parkinglot/src/lib/cc/ruby/lib/cc/message.rb
==============================================================================
--- branches/parkinglot/src/lib/cc/ruby/lib/cc/message.rb (original)
+++ branches/parkinglot/src/lib/cc/ruby/lib/cc/message.rb Fri Nov 20 14:14:19 2009
@@ -150,9 +150,9 @@
       else
         ret = pack_blob(item)
       end
-    when false
+    when FalseClass
       ret = pack_bool(item)
-    when true
+    when TrueClass
       ret = pack_bool(item)
     else
       ret = pack_blob(item.to_s)
@@ -175,7 +175,7 @@
 
   def self.encode_bool(msg)
     unless msg.class == FalseClass or msg.class == TrueClass
-      raise ArgumentError, "Should be a true or false"
+      raise ArgumentError, "Should be true or false"
     end
     if msg
       [0x01].pack("C")




More information about the bind10-changes mailing list