Ejemplo n.º 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)
}
Ejemplo n.º 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)
}
Ejemplo n.º 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)
}