diff options
| author | BurdetteLamar <burdettelamar@yahoo.com> | 2025-12-19 12:45:36 +0000 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-12-19 17:09:10 -0500 |
| commit | d540903ee77e81dd1ec3dec744273fbb394238fa (patch) | |
| tree | bd1c8d0924de5fa5cc069cec97c54226224aad1d | |
| parent | d9c0d4c71cd3500b2307c518b423ee58eeff9ae5 (diff) | |
[DOC] Harmonize <= methods
| -rw-r--r-- | compar.c | 11 | ||||
| -rw-r--r-- | hash.c | 5 | ||||
| -rw-r--r-- | numeric.c | 9 |
3 files changed, 15 insertions, 10 deletions
@@ -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 @@ -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} @@ -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 |
