Sha256: 93e1547e5890c03393990b2baabaf5bb809213f89708b96036d539447fcc0ca1
Contents?: true
Size: 1.17 KB
Versions: 20
Compression:
Stored size: 1.17 KB
Contents
#include "rucy.h" using namespace Rucy; /* do nothing. */ static VALUE do_nothing(VALUE self) { } /* return nil. */ static VALUE return_nil(VALUE self) { return nil(); } /* return int. */ static VALUE return_int(VALUE self) { return value(1); } /* return flaot. */ static VALUE return_float(VALUE self) { return value(1.0f); } /* return string. */ static VALUE return_string(VALUE self) { return value(""); } /* check_arg_count */ static VALUE arg_count_must_1(VALUE self) { check_arg_count(__FILE__, __LINE__, "arg_count_must_1", argc, 1); RUCY_SYM(ok); return ok.value(); } void Init_function () { Module mRucy = rb_define_module("Rucy"); Module mTester = rb_define_module_under(mRucy, "Tester"); rb_define_method(mTester, "do_nothing", RUBY_METHOD_FUNC(do_nothing), -1); rb_define_method(mTester, "return_nil", RUBY_METHOD_FUNC(return_nil), 0); rb_define_method(mTester, "return_int", RUBY_METHOD_FUNC(return_int), 0); rb_define_method(mTester, "return_float", RUBY_METHOD_FUNC(return_float), 0); rb_define_method(mTester, "return_string", RUBY_METHOD_FUNC(return_string), 0); rb_define_method(mTester, "arg_count_must_1", RUBY_METHOD_FUNC(arg_count_must_1), -1); }
Version data entries
20 entries across 20 versions & 1 rubygems