Permalink
Browse files

Tinkergraph loses false values if I don't use to_java on them.

  • Loading branch information...
1 parent 4b19105 commit 887e544ca13355d4f53787e704618b242d3bd39c @pangloss committed Sep 21, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/pacer/graph/simple_encoder.rb
@@ -1,16 +1,25 @@
module Pacer
class SimpleEncoder
+ JBoolean = java.lang.Boolean
+ JFalse = false.to_java
+
def self.encode_property(value)
if value.is_a? String
value = value.strip
value unless value == ''
+ elsif false == value
+ JFalse
else
value
end
end
def self.decode_property(value)
- value
+ if value.is_a? JBoolean and value == JFalse
+ false
+ else
+ value
+ end
end
end
end

0 comments on commit 887e544

Please sign in to comment.