From 731c5326b47b34364b2a8f69c6d558f52957a562 Mon Sep 17 00:00:00 2001 From: Seba Gamboa Date: Wed, 23 Sep 2015 11:42:28 -0300 Subject: Detecting classes and methods from C sources --- sample/src/sample.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sample/src') diff --git a/sample/src/sample.c b/sample/src/sample.c index 43a9e3a..e5cbae7 100644 --- a/sample/src/sample.c +++ b/sample/src/sample.c @@ -11,6 +11,8 @@ void sample_deprecated_method( void ) /** * A sample Ruby method defined from C + * + * @return [String] Hello World! */ mrb_value mrb_Sample_Hello__world(mrb_state *mrb, mrb_value self) { @@ -20,9 +22,9 @@ mrb_value mrb_Sample_Hello__world(mrb_state *mrb, mrb_value self) void mrb_sample_gem_init(mrb_state *mrb) { - struct RClass *Sample = mrb_define_module(mrb, "Sample"); - struct RClass *Sample_Hello = mrb_define_class_under(mrb, Sample, "Hello", mrb->object_class); - mrb_define_method(mrb,Sample_Hello, "world", mrb_Sample_Hello__world, MRB_ARGS_NONE() ); + struct RClass *ns = mrb_define_module(mrb, "Sample"); + struct RClass *cl = mrb_define_class_under(mrb, ns, "Hello", mrb->object_class); + mrb_define_method(mrb,cl, "world", mrb_Sample_Hello__world, MRB_ARGS_NONE() ); } void -- cgit v1.2.3