rb_mytest.c 232 B

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