summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2023-03-13 11:55:59 -0500
committerGitHub <noreply@github.com>2023-03-13 12:55:59 -0400
commit1a8a24a6332afee5020f1a3d79e625b9f3a7e3c7 (patch)
treefc8a1677bebc482b018e92bd6dd72cd842ee14d6 /rational.c
parent45127c84d992dc0224c59be341e6c652de7edd21 (diff)
downloadruby-1a8a24a6332afee5020f1a3d79e625b9f3a7e3c7.tar.gz
[DOC] Enhanced RDoc for NilClass (#7500)
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/rational.c b/rational.c
index 115cdd8d2c..58786b58ba 100644
--- a/rational.c
+++ b/rational.c
@@ -2103,9 +2103,12 @@ rb_float_denominator(VALUE self)
/*
* call-seq:
- * nil.to_r -> (0/1)
+ * to_r -> (0/1)
+ *
+ * Returns zero as a Rational:
+ *
+ * nil.to_r # => (0/1)
*
- * Returns zero as a rational.
*/
static VALUE
nilclass_to_r(VALUE self)
@@ -2115,10 +2118,14 @@ nilclass_to_r(VALUE self)
/*
* call-seq:
- * nil.rationalize([eps]) -> (0/1)
+ * rationalize(eps = nil) -> (0/1)
+ *
+ * Returns zero as a Rational:
+ *
+ * nil.rationalize # => (0/1)
+ *
+ * Argument +eps+ is ignored.
*
- * Returns zero as a rational. The optional argument +eps+ is always
- * ignored.
*/
static VALUE
nilclass_rationalize(int argc, VALUE *argv, VALUE self)