class Neo4j::TypeConverters::TimeConverter

Public Class Methods

convert?(clazz_or_symbol) click to toggle source
# File lib/neo4j/type_converters/type_converters.rb, line 196
def convert?(clazz_or_symbol)
  Time == clazz_or_symbol || :time == clazz_or_symbol
end
to_java(value) click to toggle source

Converts the given DateTime (UTC) value to an Fixnum. Only utc times are supported !

# File lib/neo4j/type_converters/type_converters.rb, line 202
def to_java(value)
  return nil if value.nil?
  if value.class == Date
    Time.utc(value.year, value.month, value.day, 0, 0, 0).to_i
  else
    value.utc.to_i
  end
end
to_ruby(value) click to toggle source
# File lib/neo4j/type_converters/type_converters.rb, line 211
def to_ruby(value)
  return nil if value.nil?
  Time.at(value).utc
end