예제 #1
0
파일: class.go 프로젝트: ujun/go-mruby
// 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)
}
예제 #2
0
파일: mruby.go 프로젝트: manveru/go-mruby
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)
}
예제 #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)
}