模块 RSS::Maker::SetupDefaultDate
私有实例方法
_parse_date_if_needed(date_value) 点击切换源代码
# File rss-0.3.1/lib/rss/maker/base.rb, line 375 def _parse_date_if_needed(date_value) date_value = Time.parse(date_value) if date_value.is_a?(String) date_value end
_set_default_values() 点击切换源代码
调用超类方法
# File rss-0.3.1/lib/rss/maker/base.rb, line 357 def _set_default_values keep = { :date => date, :dc_dates => dc_dates.to_a.dup, } _date = _parse_date_if_needed(date) if _date and !dc_dates.any? {|dc_date| dc_date.value == _date} dc_date = self.class::DublinCoreDates::DublinCoreDate.new(self) dc_date.value = _date.dup dc_dates.unshift(dc_date) end self.date ||= self.dc_date super ensure self.date = keep[:date] dc_dates.replace(keep[:dc_dates]) end