In order to create a BigDecimal from a C string in a Ruby extension, I'm doing this:
rb_funcall(rb_path2class("BigDecimal"), rb_intern("new"), 1, rb_str_new("0.0777", 6));
// => BigDecimal.new("0.0777")
Is there a shorter way to do this?
Also, stupid question, but is there an 'official' documentation for the C API (ruby 1.9.3), or does it just come down to reading the headers?