Exemple #1
0
// DefineConst defines a constant within this class.
func (c *Class) DefineConst(name string, value Value) {
	cs := C.CString(name)
	defer C.free(unsafe.Pointer(cs))

	C.mrb_define_const(
		c.mrb.state, c.class, cs, value.MrbValue(c.mrb).value)
}
Exemple #2
0
func (m *MRuby) DefineConst(class *C.struct_RClass, name string, value C.mrb_value) {
	C.mrb_define_const(m.state, class, C.CString(name), value)
}
Exemple #3
0
// DefineConst defines a constant within this class.
func (c *Class) DefineConst(name string, value Value) {
	C.mrb_define_const(
		c.mrb.state, c.class, C.CString(name), value.MrbValue(c.mrb).value)
}