summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-objectspace/src/mruby_objectspace.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-06 13:31:25 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-06 13:31:25 +0900
commit12915f95777448b9d8173e24824641eb7da10068 (patch)
tree90a5662a0eec1d10aacc786fb1fb28751365536c /mrbgems/mruby-objectspace/src/mruby_objectspace.c
parenta776e3a1ebbb7907c5699656531e47fe4a144a88 (diff)
parentc2732a160a2da0451a35d13ffb1ac24e98d042e4 (diff)
downloadmruby-12915f95777448b9d8173e24824641eb7da10068.tar.gz
mruby-12915f95777448b9d8173e24824641eb7da10068.zip
Merge pull request #2203 from yui-knk/add-call-seq
Add a comment to ObjectSpace.each_object.
Diffstat (limited to 'mrbgems/mruby-objectspace/src/mruby_objectspace.c')
-rw-r--r--mrbgems/mruby-objectspace/src/mruby_objectspace.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mrbgems/mruby-objectspace/src/mruby_objectspace.c b/mrbgems/mruby-objectspace/src/mruby_objectspace.c
index 7d3b0b74e..eccc652e2 100644
--- a/mrbgems/mruby-objectspace/src/mruby_objectspace.c
+++ b/mrbgems/mruby-objectspace/src/mruby_objectspace.c
@@ -128,6 +128,20 @@ os_each_object_cb(mrb_state *mrb, struct RBasic *obj, void *ud)
++d->count;
}
+/*
+ * call-seq:
+ * ObjectSpace.each_object([module]) {|obj| ... } -> fixnum
+ *
+ * Calls the block once for each object in this Ruby process.
+ * Returns the number of objects found.
+ * If the optional argument +module+ is given,
+ * calls the block for only those classes or modules
+ * that match (or are a subclass of) +module+.
+ *
+ * If no block is given, ArgumentError is raised.
+ *
+ */
+
static mrb_value
os_each_object(mrb_state *mrb, mrb_value self)
{