summaryrefslogtreecommitdiff
path: root/compar.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2021-05-18 08:27:41 -0500
committerJeremy Evans <code@jeremyevans.net>2021-06-21 10:38:16 -0700
commitc1741df1a1a92d227b1afd03931c3b54fb2d4429 (patch)
tree24f19b92cd202f70c745eb979379797471f2158a /compar.c
parent8509532c78ab2a8cc0efeadee6367bbe7991ee49 (diff)
What's Here for Numeric and Comparable
Diffstat (limited to 'compar.c')
-rw-r--r--compar.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/compar.c b/compar.c
index 04d4ff8c70..0de318525c 100644
--- a/compar.c
+++ b/compar.c
@@ -289,6 +289,22 @@ cmp_clamp(int argc, VALUE *argv, VALUE x)
* s4.between?(s3, s5) #=> true
* [ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV]
*
+ * == What's Here
+ *
+ * \Module \Comparable provides these methods, all of which use method <tt><=></tt>:
+ *
+ * - {<}[#method-i-3C]:: Returns whether +self+ is less than the given object.
+ * - {<=}[#method-i-3C-3D]:: Returns whether +self+ is less than or equal to
+ * the given object.
+ * - {==}[#method-i-3D-3D]:: Returns whether +self+ is equal to the given object.
+ * - {>}[#method-i-3E]:: Returns whether +self+ is greater than or equal to
+ * the given object.
+ * - {>=}[#method-i-3E-3D]:: Returns whether +self+ is greater than the given object.
+ * - #between? Returns +true+ if +self+ is between two given objects.
+ * - #clamp:: For given objects +min+ and +max+, or range <tt>(min..max)</tt>, returns:
+ * - +min+ if <tt>(self <=> min) < 0</tt>.
+ * - +max+ if <tt>(self <=> max) > 0</tt>.
+ * - +self+ otherwise.
*/
void