module MarkMapper::Extensions::Date
Public Instance Methods
from_marklogic(value)
click to toggle source
# File lib/mark_mapper/extensions/date.rb, line 16 def from_marklogic(value) value.to_date if value end
to_marklogic(value)
click to toggle source
# File lib/mark_mapper/extensions/date.rb, line 5 def to_marklogic(value) if value.nil? || (value.instance_of?(String) && '' === value) nil else date = value.instance_of?(::Date) || value.instance_of?(::Time) ? value : ::Date.parse(value.to_s) ::Time.utc(date.year, date.month, date.day) end rescue nil end
xs_type()
click to toggle source
# File lib/mark_mapper/extensions/date.rb, line 20 def xs_type "date" end