[DOC] Harmonize <= methods

This commit is contained in:
BurdetteLamar 2025-12-19 12:45:36 +00:00 committed by Peter Zhu
parent d9c0d4c71c
commit d540903ee7
Notes: git 2025-12-19 22:09:49 +00:00
3 changed files with 15 additions and 10 deletions

View File

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

5
hash.c
View File

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

View File

@ -1738,7 +1738,8 @@ flo_lt(VALUE x, VALUE y)
* call-seq:
* self <= other -> true or false
*
* Returns +true+ if +self+ is numerically less than or equal to +other+:
* Returns whether the value of +self+ is less than or equal to the value of +other+;
* +other+ must be numeric, but may not be Complex:
*
* 2.0 <= 3 # => true
* 2.0 <= 3.0 # => true
@ -5081,10 +5082,10 @@ fix_le(VALUE x, VALUE y)
/*
* call-seq:
* self <= real -> true or false
* self <= other -> true or false
*
* Returns +true+ if the value of +self+ is less than or equal to
* that of +other+:
* Returns whether the value of +self+ is less than or equal to the value of +other+;
* +other+ must be numeric, but may not be Complex:
*
* 1 <= 0 # => false
* 1 <= 1 # => true