diff options
| author | yui-knk <[email protected]> | 2014-05-06 12:41:23 +0900 |
|---|---|---|
| committer | yui-knk <[email protected]> | 2014-05-06 12:41:23 +0900 |
| commit | c2732a160a2da0451a35d13ffb1ac24e98d042e4 (patch) | |
| tree | 90a5662a0eec1d10aacc786fb1fb28751365536c /mrbgems/mruby-objectspace/src | |
| parent | a776e3a1ebbb7907c5699656531e47fe4a144a88 (diff) | |
| download | mruby-c2732a160a2da0451a35d13ffb1ac24e98d042e4.tar.gz mruby-c2732a160a2da0451a35d13ffb1ac24e98d042e4.zip | |
Add a comment to ObjectSpace.each_object.
Diffstat (limited to 'mrbgems/mruby-objectspace/src')
| -rw-r--r-- | mrbgems/mruby-objectspace/src/mruby_objectspace.c | 14 |
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) { |
