rb_mytest.c (232B)
1 2 #include <ruby.h> 3 4 static VALUE 5 m_hello (VALUE self) 6 { 7 return rb_str_new2("Hello World"); 8 } 9 10 void 11 Init_mytest_ext (void) 12 { 13 VALUE mTest = rb_define_module ("MytestInt"); 14 15 rb_define_module_function (mTest, "hello", m_hello, 0); 16 }