@@ -252,6 +252,10 @@ def make_time(year, mon, day, hour, min, sec, sec_fraction, zone, now)
252
252
#
253
253
# A failure for Time.parse should be checked, though.
254
254
#
255
+ # time library should be required to use this method as follows.
256
+ #
257
+ # require 'time'
258
+ #
255
259
def parse ( date , now = self . now )
256
260
comp = !block_given?
257
261
d = Date . _parse ( date , comp )
@@ -293,6 +297,10 @@ def strptime(date, format, now=self.now)
293
297
#
294
298
# See #rfc2822 for more information on this format.
295
299
#
300
+ # time library should be required to use this method as follows.
301
+ #
302
+ # require 'time'
303
+ #
296
304
def rfc2822 ( date )
297
305
if /\A \s *
298
306
(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s *,\s *)?
@@ -342,6 +350,10 @@ def rfc2822(date)
342
350
#
343
351
# See #httpdate for more information on this format.
344
352
#
353
+ # time library should be required to use this method as follows.
354
+ #
355
+ # require 'time'
356
+ #
345
357
def httpdate ( date )
346
358
if /\A \s *
347
359
(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\x20
@@ -389,6 +401,10 @@ def httpdate(date)
389
401
#
390
402
# See #xmlschema for more information on this format.
391
403
#
404
+ # time library should be required to use this method as follows.
405
+ #
406
+ # require 'time'
407
+ #
392
408
def xmlschema ( date )
393
409
if /\A \s *
394
410
(-?\d +)-(\d \d )-(\d \d )
@@ -431,6 +447,10 @@ def xmlschema(date)
431
447
#
432
448
# If +self+ is a UTC time, -0000 is used as zone.
433
449
#
450
+ # time library should be required to use this method as follows.
451
+ #
452
+ # require 'time'
453
+ #
434
454
def rfc2822
435
455
sprintf ( '%s, %02d %s %0*d %02d:%02d:%02d ' ,
436
456
RFC2822_DAY_NAME [ wday ] ,
@@ -462,6 +482,10 @@ def rfc2822
462
482
#
463
483
# Note that the result is always UTC (GMT).
464
484
#
485
+ # time library should be required to use this method as follows.
486
+ #
487
+ # require 'time'
488
+ #
465
489
def httpdate
466
490
t = dup . utc
467
491
sprintf ( '%s, %02d %s %0*d %02d:%02d:%02d GMT' ,
@@ -484,6 +508,10 @@ def httpdate
484
508
# +fractional_seconds+ specifies a number of digits of fractional seconds.
485
509
# Its default value is 0.
486
510
#
511
+ # time library should be required to use this method as follows.
512
+ #
513
+ # require 'time'
514
+ #
487
515
def xmlschema ( fraction_digits = 0 )
488
516
sprintf ( '%0*d-%02d-%02dT%02d:%02d:%02d' ,
489
517
year < 0 ? 5 : 4 , year , mon , day , hour , min , sec ) +
0 commit comments