From 64092de25727c1943807bf5345107d90428135a0 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 2 May 2008 14:45:23 +0100 Subject: Improve documentation coverage and markup Signed-off-by: Pratik Naik --- activesupport/lib/active_support/time_with_zone.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'activesupport/lib/active_support/time_with_zone.rb') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index f1a2498298..461d52e40e 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -101,7 +101,8 @@ module ActiveSupport end alias_method :rfc822, :rfc2822 - # :db format outputs time in UTC; all others output time in local. Uses TimeWithZone's strftime, so %Z and %z work correctly + # :db format outputs time in UTC; all others output time in local. + # Uses TimeWithZone's +strftime+, so %Z and %z work correctly. def to_s(format = :default) return utc.to_s(format) if format == :db if formatter = ::Time::DATE_FORMATS[format] @@ -111,7 +112,7 @@ module ActiveSupport end end - # Replaces %Z and %z directives with #zone and #formatted_offset, respectively, before passing to + # Replaces %Z and %z directives with +zone+ and +formatted_offset+, respectively, before passing to # Time#strftime, so that zone information is correct def strftime(format) format = format.gsub('%Z', zone).gsub('%z', formatted_offset(false)) @@ -138,9 +139,9 @@ module ActiveSupport result.in_time_zone(time_zone) end - # If a time-like object is passed in, compare it with #utc - # Else if wrapped #time is a DateTime, use DateTime#ago instead of #- - # Otherwise, just pass on to method missing + # If a time-like object is passed in, compare it with +utc+. + # Else if wrapped +time+ is a DateTime, use DateTime#ago instead of DateTime#-. + # Otherwise, just pass on to +method_missing+. def -(other) if other.acts_like?(:time) utc - other @@ -180,7 +181,7 @@ module ActiveSupport alias_method :hash, :to_i alias_method :tv_sec, :to_i - # A TimeWithZone acts like a Time, so just return self + # A TimeWithZone acts like a Time, so just return +self+. def to_time self end -- cgit v1.2.3