diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-25 08:26:06 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-08-25 08:26:06 +0000 |
commit | df9d49d0881d9596b9b7d23dbd42950d5048bd9d (patch) | |
tree | 11dbf94b16c3de9756d62f43e113323d8d4d3883 /string.c | |
parent | d68d1d15843125c6ae91055feb05f08b8c70e4f6 (diff) | |
download | ruby-df9d49d0881d9596b9b7d23dbd42950d5048bd9d.tar.gz |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2754,6 +2754,18 @@ rb_str_center(str, w) } void +rb_str_setter(val, id, var) + VALUE val; + ID id; + VALUE *var; +{ + if (!NIL_P(val) && TYPE(val) != T_STRING) { + rb_raise(rb_eTypeError, "value of %s must be String", rb_id2name(id)); + } + *var = val; +} + +void Init_String() { rb_cString = rb_define_class("String", rb_cObject); |