aboutsummaryrefslogtreecommitdiffstats
path: root/symbol.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 07:23:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 07:23:23 +0000
commit38828e61970293b1be6113413cbce96294280953 (patch)
tree57a01309af17a79bcf3f47f2bb95cf135fa955ca /symbol.c
parent9016f61ef226ec0acf6cfc7ddc429257312ca1db (diff)
downloadruby-38828e61970293b1be6113413cbce96294280953.tar.gz
common conversion functions
* array.c (rb_to_array_type): make public to share common code internally. * hash.c (rb_to_hash_type): make public to share common code internally. * symbol.c (rb_to_symbol_type): make public to share common code internally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index 45d49d20d9..147c11f007 100644
--- a/symbol.c
+++ b/symbol.c
@@ -1044,6 +1044,12 @@ rb_sym_intern_ascii_cstr(const char *ptr)
return rb_sym_intern_ascii(ptr, strlen(ptr));
}
+VALUE
+rb_to_symbol_type(VALUE obj)
+{
+ return rb_convert_type_with_id(obj, T_SYMBOL, "Symbol", idTo_sym);
+}
+
static ID
attrsetname_to_attr_id(VALUE name)
{