Skip to content

Commit

Permalink
Added rb_str_inspect.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Jul 5, 2012
1 parent 2aec635 commit 94ee12f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vm/capi/18/include/ruby.h
Expand Up @@ -1531,6 +1531,9 @@ VALUE rb_uint2big(unsigned long number);
/** As Ruby's String#dup, returns copy of self as a new String. */
VALUE rb_str_dup(VALUE self);

/** Returns an escaped String. */
VALUE rb_str_inspect(VALUE self);

/** Returns a symbol created from this string. */
VALUE rb_str_intern(VALUE self);

Expand Down
3 changes: 3 additions & 0 deletions vm/capi/19/include/ruby/ruby.h
Expand Up @@ -1655,6 +1655,9 @@ VALUE rb_uint2big(unsigned long number);
/** As Ruby's String#dup, returns copy of self as a new String. */
VALUE rb_str_dup(VALUE self);

/** Returns an escaped String. */
VALUE rb_str_inspect(VALUE self);

/** Returns a symbol created from this string. */
VALUE rb_str_intern(VALUE self);

Expand Down
4 changes: 4 additions & 0 deletions vm/capi/string.cpp
Expand Up @@ -245,6 +245,10 @@ extern "C" {
return env->get_handle(string->string_dup(env->state()));
}

VALUE rb_str_inspect(VALUE self) {
return rb_funcall(self, rb_intern("inspect"), 0);
}

VALUE rb_str_intern(VALUE self) {
return rb_funcall(self, rb_intern("to_sym"), 0);
}
Expand Down

0 comments on commit 94ee12f

Please sign in to comment.