• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

mrubyを超漢字で動作させる


Commit MetaInfo

Revisãof07ee20260156e07c2ca5efe63bf0ea9f3ac8132 (tree)
Hora2015-10-18 00:16:02
AutorYukihiro "Matz" Matsumoto <matz@ruby...>
CommiterYukihiro "Matz" Matsumoto

Mensagem de Log

Merge pull request #2995 from Mav7/master

fixed YARD documentation for mrb_obj_new

Mudança Sumário

Diff

--- a/include/mruby.h
+++ b/include/mruby.h
@@ -496,6 +496,24 @@ MRB_API void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
496496 /**
497497 * Initialize a new object instace of c class.
498498 *
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+ * }
499517 * @param mrb The current mruby state.
500518 * @param c Reference to the class of the new object.
501519 * @param argc Number of arguments in argv