public
Description: Repository for improving Rails documentation
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/lifo/doc-rails.git
Search Repo:
doc tweaks in time_with_zone.rb
Xavier Noria (author)
Sat Apr 19 12:40:56 -0700 2008
commit  30c75aa61f2ad1d3b24ad414cb8edd509c67b851
tree    c8846a8fde288adf03394e30d0255641b5951e3f
parent  a0eb213b91f39930f0ceeb1f4563d1dca02e5a9f
...
97
98
99
100
 
 
101
102
103
...
107
108
109
110
 
111
112
113
...
133
134
135
136
137
138
 
 
 
139
140
141
...
162
163
164
165
 
166
167
168
...
97
98
99
 
100
101
102
103
104
...
108
109
110
 
111
112
113
114
...
134
135
136
 
 
 
137
138
139
140
141
142
...
163
164
165
 
166
167
168
169
0
@@ -97,7 +97,8 @@
0
     end
0
     alias_method :rfc822, :rfc2822
0
   
0
- # :db format outputs time in UTC; all others output time in local. Uses TimeWithZone's strftime, so %Z and %z work correctly
0
+ # <tt>:db</tt> format outputs time in UTC; all others output time in local.
0
+ # Uses TimeWithZone's +strftime+, so <tt>%Z</tt> and <tt>%z</tt> work correctly.
0
     def to_s(format = :default)
0
       return utc.to_s(format) if format == :db
0
       if formatter = ::Time::DATE_FORMATS[format]
0
@@ -107,7 +108,7 @@
0
       end
0
     end
0
     
0
- # Replaces %Z and %z directives with #zone and #formatted_offset, respectively, before passing to
0
+ # Replaces <tt>%Z</tt> and <tt>%z</tt> directives with +zone+ and +formatted_offset+, respectively, before passing to
0
     # Time#strftime, so that zone information is correct
0
     def strftime(format)
0
       format = format.gsub('%Z', zone).gsub('%z', formatted_offset(false))
0
@@ -133,9 +134,9 @@
0
       time.acts_like?(:date) ? method_missing(:since, other) : method_missing(:+, other)
0
     end
0
     
0
- # If a time-like object is passed in, compare it with #utc
0
- # Else if wrapped #time is a DateTime, use DateTime#ago instead of #-
0
- # Otherwise, just pass on to method missing
0
+ # If a time-like object is passed in, compare it with +utc+.
0
+ # Else if wrapped +time+ is a DateTime, use DateTime#ago instead of DateTime#-.
0
+ # Otherwise, just pass on to +method_missing+.
0
     def -(other)
0
       if other.acts_like?(:time)
0
         utc - other
0
@@ -162,7 +163,7 @@
0
     alias_method :hash, :to_i
0
     alias_method :tv_sec, :to_i
0
   
0
- # A TimeWithZone acts like a Time, so just return self
0
+ # A TimeWithZone acts like a Time, so just return +self+.
0
     def to_time
0
       self
0
     end

Comments

    No one has commented yet.