class Neo4j::Shared::TypeConverters::TimeConverter

Public Class Methods

convert_type() click to toggle source
    # File lib/neo4j/shared/type_converters.rb
203 def convert_type
204   Time
205 end
db_type() click to toggle source
    # File lib/neo4j/shared/type_converters.rb
207 def db_type
208   Integer
209 end
to_db(value) click to toggle source

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

    # File lib/neo4j/shared/type_converters.rb
213 def to_db(value)
214   if value.class == Date
215     Time.utc(value.year, value.month, value.day, 0, 0, 0).to_i
216   else
217     value.utc.to_i
218   end
219 end
to_ruby(value) click to toggle source
    # File lib/neo4j/shared/type_converters.rb
221 def to_ruby(value)
222   Time.at(value).utc
223 end