Class: Time

Inherits:
Object show all
Defined in:
lib/xapian_fu/xapian_doc.rb,
lib/xapian_fu/xapian_doc_value_accessor.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xapian_fu_storage_value(value) ⇒ Object



51
52
53
# File 'lib/xapian_fu/xapian_doc_value_accessor.rb', line 51

def self.from_xapian_fu_storage_value(value)
  Time.at(value.unpack("G").first) rescue nil
end

.to_xapian_fu_storage_value(value) ⇒ Object



47
48
49
# File 'lib/xapian_fu/xapian_doc_value_accessor.rb', line 47

def self.to_xapian_fu_storage_value(value)
  [value.utc.to_f].pack("G")
end

Instance Method Details

#to_xapian_fu_stringObject



2
3
4
# File 'lib/xapian_fu/xapian_doc.rb', line 2

def to_xapian_fu_string
  utc.strftime("%Y%m%d%H%M%S")
end