From db2ea9b0c5fb49a04af1b299a37e92f81d7cccd2 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 15 Dec 2019 00:21:19 +0900 Subject: [PATCH] [DOC] Fixed the class name in FrozenError#receiver --- error.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/error.c b/error.c index 7ef252f395..9da36ae2e3 100644 --- a/error.c +++ b/error.c @@ -1435,6 +1435,15 @@ frozen_err_initialize(int argc, VALUE *argv, VALUE self) return self; } +/* + * call-seq: + * frozen_error.receiver -> object + * + * Return the receiver associated with this FrozenError exception. + */ + +#define frozen_err_receiver name_err_receiver + void rb_name_error(ID id, const char *fmt, ...) { @@ -2529,7 +2538,7 @@ Init_Exception(void) rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError); rb_eFrozenError = rb_define_class("FrozenError", rb_eRuntimeError); rb_define_method(rb_eFrozenError, "initialize", frozen_err_initialize, -1); - rb_define_method(rb_eFrozenError, "receiver", name_err_receiver, 0); + rb_define_method(rb_eFrozenError, "receiver", frozen_err_receiver, 0); rb_eSecurityError = rb_define_class("SecurityError", rb_eException); rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException); rb_eEncodingError = rb_define_class("EncodingError", rb_eStandardError);