summaryrefslogtreecommitdiff
path: root/symbol.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-24 10:53:12 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-24 10:53:12 +0900
commitb10c9d201222b144df7d63660d1c731af53c4ae2 (patch)
tree9ddcc32507ef7e5e45c836fb4812bb43439abbe3 /symbol.c
parent8b8b7c78762f1ec7446f4a35c7bb8093d78fb248 (diff)
[DOC] Added document for rb_check_symbol() [ci skip]
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index a0aa4cc75f..185c6a8c82 100644
--- a/symbol.c
+++ b/symbol.c
@@ -957,6 +957,18 @@ rb_check_id(volatile VALUE *namep)
return lookup_str_id(name);
}
+/**
+ * Returns Symbol for the given name if it is interned already, or
+ * nil.
+ *
+ * \param namep the pointer to the name object
+ * \return the Symbol for *namep
+ * \pre the object referred by \p namep must be a Symbol or
+ * a String, or possible to convert with to_str method.
+ * \post the object referred by \p namep is a Symbol or a
+ * String if non-nil value is returned, or is a String
+ * if nil is returned.
+ */
VALUE
rb_check_symbol(volatile VALUE *namep)
{