summaryrefslogtreecommitdiffhomepage
path: root/sample/src
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-23 11:42:28 -0300
committerSeba Gamboa <[email protected]>2015-09-23 11:42:37 -0300
commit731c5326b47b34364b2a8f69c6d558f52957a562 (patch)
tree213d83fe80cd4ab7922e5e0879d3bcbd01db9a8a /sample/src
parenta88dcf7f44898495fd2d2535ec0c4508a4458c38 (diff)
downloadyard-mruby-731c5326b47b34364b2a8f69c6d558f52957a562.tar.gz
yard-mruby-731c5326b47b34364b2a8f69c6d558f52957a562.zip
Detecting classes and methods from C sources
Diffstat (limited to 'sample/src')
-rw-r--r--sample/src/sample.c8
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