diff options
Diffstat (limited to 'sample/src/sample.c')
| -rw-r--r-- | sample/src/sample.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
