Skip to content

Commit

Permalink
Tinkergraph loses false values if I don't use to_java on them.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrick Wiebe committed Sep 21, 2012
1 parent 4b19105 commit 887e544
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 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.