[DOC] Harmonize #>= methods

This commit is contained in:
BurdetteLamar 2026-01-05 16:18:16 +00:00 committed by Peter Zhu
parent 7a1180afb6
commit a25f468917
Notes: git 2026-01-05 23:24:27 +00:00
3 changed files with 15 additions and 10 deletions

View File

@ -109,10 +109,15 @@ cmp_gt(VALUE x, VALUE y)
/*
* call-seq:
* obj >= other -> true or false
* self >= other -> true or false
*
* Returns whether +self+ is "greater than or equal to" +other+;
* equivalent to <tt>(self <=> other) >= 0</tt>:
*
* 'food' >= 'foo' # => true
* 'foo' >= 'foo' # => true
* 'foo' >= 'food' # => false
*
* Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns a value greater than or equal to 0.
*/
static VALUE

5
hash.c
View File

@ -4950,10 +4950,9 @@ rb_hash_lt(VALUE hash, VALUE other)
/*
* call-seq:
* self >= other_hash -> true or false
* self >= other -> true or false
*
* Returns +true+ if the entries of +self+ are a superset of the entries of +other_hash+,
* +false+ otherwise:
* Returns whether the entries of +self+ are a superset of the entries of +other+:
*
* h0 = {foo: 0, bar: 1, baz: 2}
* h1 = {foo: 0, bar: 1}

View File

@ -1674,7 +1674,8 @@ rb_float_gt(VALUE x, VALUE y)
* call-seq:
* self >= other -> true or false
*
* Returns +true+ if +self+ is numerically greater than or equal to +other+:
* Returns whether the value of +self+ is greater than or equal to the value of +other+;
* +other+ must be numeric, but may not be Complex:
*
* 2.0 >= 1 # => true
* 2.0 >= 1.0 # => true
@ -5001,10 +5002,10 @@ fix_ge(VALUE x, VALUE y)
/*
* call-seq:
* self >= real -> true or false
* self >= other -> true or false
*
* Returns +true+ if the value of +self+ is greater than or equal to
* that of +other+:
* Returns whether the value of +self+ is greater than or equal to the value of +other+;
* +other+ must be numeric, but may not be Complex:
*
* 1 >= 0 # => true
* 1 >= 1 # => true