mrubyを超漢字で動作させる
Revisão | f07ee20260156e07c2ca5efe63bf0ea9f3ac8132 (tree) |
---|---|
Hora | 2015-10-18 00:16:02 |
Autor | Yukihiro "Matz" Matsumoto <matz@ruby...> |
Commiter | Yukihiro "Matz" Matsumoto |
Merge pull request #2995 from Mav7/master
fixed YARD documentation for mrb_obj_new
@@ -496,6 +496,24 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*); | ||
496 | 496 | /** |
497 | 497 | * Initialize a new object instace of c class. |
498 | 498 | * |
499 | + * # Ruby style | |
500 | + * class ExampleClass | |
501 | + * end | |
502 | + * | |
503 | + * p ExampleClass # => #<ExampleClass:0x9958588> | |
504 | + * // C style | |
505 | + * #include <stdio.h> | |
506 | + * #include <mruby.h> | |
507 | + * | |
508 | + * void | |
509 | + * mrb_example_gem_init(mrb_state* mrb) { | |
510 | + * struct RClass *example_class; | |
511 | + * mrb_value obj; | |
512 | + * | |
513 | + * example_class = mrb_define_class(mrb, "ExampleClass", mrb->object_class); # => class ExampleClass; end | |
514 | + * obj = mrb_obj_new(mrb, example_class, 0, NULL); # => ExampleClass.new | |
515 | + * mrb_p(mrb, obj); // => Kernel#p | |
516 | + * } | |
499 | 517 | * @param mrb The current mruby state. |
500 | 518 | * @param c Reference to the class of the new object. |
501 | 519 | * @param argc Number of arguments in argv |