Sha256: 6f6f08a9d3b24f94f201c5a70a2e6777b6e8ea5138f06fc801a9893b6b991381

Contents?: true

Size: 558 Bytes

Versions: 30

Compression:

Stored size: 558 Bytes

Contents

module Pacer
  class SimpleEncoder
    JBoolean = java.lang.Boolean
    JDate = java.util.Date
    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)
      if value.is_a? JBoolean and value == JFalse
        false
      elsif value.is_a? JDate
        Time.at value.getTime() / 1000.0
      else
        value
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
pacer-2.0.24-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.22-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.20-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.19-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.18-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.17-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.16-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.15-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.14-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.13-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.12-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.10-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.10.pre-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.8-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.6-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.4.pre-java lib/pacer/graph/simple_encoder.rb
pacer-2.0.0.pre-java lib/pacer/graph/simple_encoder.rb
pacer-1.6.0-java lib/pacer/graph/simple_encoder.rb
pacer-1.5.4-java lib/pacer/graph/simple_encoder.rb
pacer-1.5.3-java lib/pacer/graph/simple_encoder.rb