method
to_r
v1_9_1_378 -
Show latest stable
- Class:
String
to_r()public
No documentation available.
static VALUE
string_to_r(VALUE self)
{
VALUE s, a, backref;
backref = rb_backref_get();
rb_match_busy(backref);
s = f_gsub(self, underscores_pat, an_underscore);
a = string_to_r_internal(s);
rb_backref_set(backref);
if (!NIL_P(RARRAY_PTR(a)[0]))
return RARRAY_PTR(a)[0];
return rb_rational_new1(INT2FIX(0));
}