// NewMrb creates a new instance of Mrb, representing the state of a single // Ruby VM. // // When you're finished with the VM, clean up all resources it is using // by calling the Close method. func NewMrb() *Mrb { state := C.mrb_open() return &Mrb{ state: state, } }
// Creates new mruby VM. Panics if it's not possible. func New() *MRuby { state := C.mrb_open() if state == nil { panic(errors.New("gomruby bug: failed to create mruby state")) } return &MRuby{state} }
func New() *MRuby { return &MRuby{C.mrb_open()} }