@@ -6344,9 +6344,9 @@ d_lite_prev_day(int argc, VALUE *argv, VALUE self)
6344
6344
*
6345
6345
* Returns a new \Date object representing the following day:
6346
6346
*
6347
- * d = Date.today
6348
- * d.to_s # => "2022-07-11 "
6349
- * d.next.to_s # => "2022-07-12 "
6347
+ * d = Date.new(2001, 2, 3)
6348
+ * d.to_s # => "2001-02-03 "
6349
+ * d.next.to_s # => "2001-02-04 "
6350
6350
*
6351
6351
* Date#succ is an alias for Date#next.
6352
6352
*/
@@ -6732,13 +6732,13 @@ cmp_dd(VALUE self, VALUE other)
6732
6732
*
6733
6733
* d <=> DateTime.new(2022, 7, 26) # => 1
6734
6734
* d <=> DateTime.new(2022, 7, 27) # => 0
6735
- * d <=> DateTime.new(2022, 7, 29 ) # => -1
6735
+ * d <=> DateTime.new(2022, 7, 28 ) # => -1
6736
6736
*
6737
6737
* - A numeric (compares <tt>self.ajd</tt> to +other+):
6738
6738
*
6739
- * d <=> 2459789 # => -1
6740
6739
* d <=> 2459788 # => -1
6741
6740
* d <=> 2459787 # => 1
6741
+ * d <=> 2459786 # => 1
6742
6742
* d <=> d.ajd # => 0
6743
6743
*
6744
6744
* - Any other object:
@@ -6804,20 +6804,39 @@ equal_gen(VALUE self, VALUE other)
6804
6804
6805
6805
/*
6806
6806
* call-seq:
6807
- * d === other -> bool
6808
- *
6809
- * Returns true if they are the same day.
6810
- *
6811
- * Date.new(2001,2,3) === Date.new(2001,2,3)
6812
- * #=> true
6813
- * Date.new(2001,2,3) === Date.new(2001,2,4)
6814
- * #=> false
6815
- * DateTime.new(2001,2,3) === DateTime.new(2001,2,3,12)
6816
- * #=> true
6817
- * DateTime.new(2001,2,3) === DateTime.new(2001,2,3,0,0,0,'+24:00')
6818
- * #=> true
6819
- * DateTime.new(2001,2,3) === DateTime.new(2001,2,4,0,0,0,'+24:00')
6820
- * #=> false
6807
+ * self === other -> true, false, or nil.
6808
+ *
6809
+ * Returns +true+ if +self+ and +other+ represent the same date,
6810
+ * +false+ if not, +nil+ if the two are not comparable.
6811
+ *
6812
+ * Argument +other+ may be:
6813
+ *
6814
+ * - Another \Date object:
6815
+ *
6816
+ * d = Date.new(2022, 7, 27) # => #<Date: 2022-07-27 ((2459788j,0s,0n),+0s,2299161j)>
6817
+ * prev_date = d.prev_day # => #<Date: 2022-07-26 ((2459787j,0s,0n),+0s,2299161j)>
6818
+ * next_date = d.next_day # => #<Date: 2022-07-28 ((2459789j,0s,0n),+0s,2299161j)>
6819
+ * d === prev_date # => false
6820
+ * d === d # => true
6821
+ * d === next_date # => false
6822
+ *
6823
+ * - A DateTime object:
6824
+ *
6825
+ * d === DateTime.new(2022, 7, 26) # => false
6826
+ * d === DateTime.new(2022, 7, 27) # => true
6827
+ * d === DateTime.new(2022, 7, 28) # => false
6828
+ *
6829
+ * - A numeric (compares <tt>self.jd</tt> to +other+):
6830
+ *
6831
+ * d === 2459788 # => true
6832
+ * d === 2459787 # => false
6833
+ * d === 2459786 # => false
6834
+ * d === d.jd # => true
6835
+ *
6836
+ * - An object not comparable:
6837
+ *
6838
+ * d === Object.new # => nil
6839
+ *
6821
6840
*/
6822
6841
static VALUE
6823
6842
d_lite_equal (VALUE self , VALUE other )
@@ -6880,12 +6899,14 @@ static VALUE strftimev(const char *, VALUE,
6880
6899
6881
6900
/*
6882
6901
* call-seq:
6883
- * d. to_s -> string
6902
+ * to_s -> string
6884
6903
*
6885
- * Returns a string in an ISO 8601 format. (This method doesn't use the
6886
- * expanded representations.)
6904
+ * Returns a string representation of the date in +self+
6905
+ * in {ISO 8601 extended date format}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html#label-ISO+8601+Format+Specifications]
6906
+ * (<tt>'%Y-%m-%d'</tt>):
6907
+ *
6908
+ * Date.new(2001, 2, 3).to_s # => "2001-02-03"
6887
6909
*
6888
- * Date.new(2001,2,3).to_s #=> "2001-02-03"
6889
6910
*/
6890
6911
static VALUE
6891
6912
d_lite_to_s (VALUE self )
@@ -6966,14 +6987,13 @@ mk_inspect(union DateData *x, VALUE klass, VALUE to_s)
6966
6987
6967
6988
/*
6968
6989
* call-seq:
6969
- * d.inspect -> string
6990
+ * inspect -> string
6991
+ *
6992
+ * Returns a string representation of +self+:
6970
6993
*
6971
- * Returns the value as a string for inspection.
6994
+ * Date.new(2001, 2, 3).inspect
6995
+ * # => "#<Date: 2001-02-03 ((2451944j,0s,0n),+0s,2299161j)>"
6972
6996
*
6973
- * Date.new(2001,2,3).inspect
6974
- * #=> "#<Date: 2001-02-03>"
6975
- * DateTime.new(2001,2,3,4,5,6,'-7').inspect
6976
- * #=> "#<DateTime: 2001-02-03T04:05:06-07:00>"
6977
6997
*/
6978
6998
static VALUE
6979
6999
d_lite_inspect (VALUE self )
@@ -7155,12 +7175,12 @@ date_strftime_internal(int argc, VALUE *argv, VALUE self,
7155
7175
7156
7176
/*
7157
7177
* call-seq:
7158
- * strftime(format = '%F') -> string
7178
+ * strftime(format = '%F') -> string
7159
7179
*
7160
- * Returns a string representation of +self+,
7180
+ * Returns a string representation of the date in +self+,
7161
7181
* formatted according the given +format+:
7162
7182
*
7163
- * Date.today .strftime # => "2022-07-01 "
7183
+ * Date.new(2001, 2, 3) .strftime # => "2001-02-03 "
7164
7184
*
7165
7185
* For other formats, see
7166
7186
* {Formats for Dates and Times}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html].
@@ -7192,13 +7212,17 @@ strftimev(const char *fmt, VALUE self,
7192
7212
7193
7213
/*
7194
7214
* call-seq:
7195
- * d.asctime -> string
7196
- * d.ctime -> string
7215
+ * asctime -> string
7216
+ *
7217
+ * Equivalent to #strftime with argument <tt>'%a %b %e %T %Y'</tt>
7218
+ * (or its {shorthand form}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html#label-Shorthand+Conversion+Specifiers]
7219
+ * <tt>'%c'</tt>):
7197
7220
*
7198
- * Returns a string in asctime(3) format (but without "\n\0" at the
7199
- * end). This method is equivalent to strftime('%c').
7221
+ * Date.new(2001, 2, 3).asctime # => "Sat Feb 3 00:00:00 2001"
7200
7222
*
7201
- * See also asctime(3) or ctime(3).
7223
+ * See {asctime}[https://linux.die.net/man/3/asctime].
7224
+ *
7225
+ * Date#ctime is an alias for Date#asctime.
7202
7226
*/
7203
7227
static VALUE
7204
7228
d_lite_asctime (VALUE self )
@@ -7208,10 +7232,15 @@ d_lite_asctime(VALUE self)
7208
7232
7209
7233
/*
7210
7234
* call-seq:
7211
- * d.iso8601 -> string
7212
- * d.xmlschema -> string
7235
+ * iso8601 -> string
7236
+ *
7237
+ * Equivalent to #strftime with argument <tt>'%Y-%m-%d'</tt>
7238
+ * (or its {shorthand form}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html#label-Shorthand+Conversion+Specifiers]
7239
+ * <tt>'%F'</tt>);
7213
7240
*
7214
- * This method is equivalent to strftime('%F').
7241
+ * Date.new(2001, 2, 3).iso8601 # => "2001-02-03"
7242
+ *
7243
+ * Date#xmlschema is an alias for Date#iso8601.
7215
7244
*/
7216
7245
static VALUE
7217
7246
d_lite_iso8601 (VALUE self )
@@ -7221,9 +7250,13 @@ d_lite_iso8601(VALUE self)
7221
7250
7222
7251
/*
7223
7252
* call-seq:
7224
- * d.rfc3339 -> string
7253
+ * rfc3339 -> string
7254
+ *
7255
+ * Equivalent to #strftime with argument <tt>'%FT%T%:z'</tt>;
7256
+ * see {Formats for Dates and Times}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html]:
7257
+ *
7258
+ * Date.new(2001, 2, 3).rfc3339 # => "2001-02-03T00:00:00+00:00"
7225
7259
*
7226
- * This method is equivalent to strftime('%FT%T%:z').
7227
7260
*/
7228
7261
static VALUE
7229
7262
d_lite_rfc3339 (VALUE self )
@@ -7233,10 +7266,14 @@ d_lite_rfc3339(VALUE self)
7233
7266
7234
7267
/*
7235
7268
* call-seq:
7236
- * d.rfc2822 -> string
7237
- * d.rfc822 -> string
7269
+ * rfc2822 -> string
7270
+ *
7271
+ * Equivalent to #strftime with argument <tt>'%a, %-d %b %Y %T %z'</tt>;
7272
+ * see {Formats for Dates and Times}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html]:
7273
+ *
7274
+ * Date.new(2001, 2, 3).rfc2822 # => "Sat, 3 Feb 2001 00:00:00 +0000"
7238
7275
*
7239
- * This method is equivalent to strftime('%a, %-d %b %Y %T %z') .
7276
+ * Date#rfc822 is an alias for Date#rfc2822 .
7240
7277
*/
7241
7278
static VALUE
7242
7279
d_lite_rfc2822 (VALUE self )
@@ -7246,10 +7283,13 @@ d_lite_rfc2822(VALUE self)
7246
7283
7247
7284
/*
7248
7285
* call-seq:
7249
- * d.httpdate -> string
7286
+ * httpdate -> string
7287
+ *
7288
+ * Equivalent to #strftime with argument <tt>'%a, %d %b %Y %T GMT'</tt>;
7289
+ * see {Formats for Dates and Times}[https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html]:
7290
+ *
7291
+ * Date.new(2001, 2, 3).httpdate # => "Sat, 03 Feb 2001 00:00:00 GMT"
7250
7292
*
7251
- * This method is equivalent to strftime('%a, %d %b %Y %T GMT').
7252
- * See also RFC 2616.
7253
7293
*/
7254
7294
static VALUE
7255
7295
d_lite_httpdate (VALUE self )
@@ -7300,11 +7340,13 @@ jisx0301_date_format(char *fmt, size_t size, VALUE jd, VALUE y)
7300
7340
7301
7341
/*
7302
7342
* call-seq:
7303
- * d. jisx0301 -> string
7343
+ * jisx0301 -> string
7304
7344
*
7305
- * Returns a string in a JIS X 0301 format.
7345
+ * Returns a string representation of the date in +self+
7346
+ * in JIS X 0301 format.
7347
+ *
7348
+ * Date.new(2001, 2, 3).jisx0301 # => "H13.02.03"
7306
7349
*
7307
- * Date.new(2001,2,3).jisx0301 #=> "H13.02.03"
7308
7350
*/
7309
7351
static VALUE
7310
7352
d_lite_jisx0301 (VALUE self )
0 commit comments