diff options
| author | skandhas <[email protected]> | 2012-11-26 12:10:15 +0800 |
|---|---|---|
| committer | skandhas <[email protected]> | 2012-11-26 12:10:15 +0800 |
| commit | 1f3c5125648e10ac5d9dc90be66025b4741fa24d (patch) | |
| tree | 437e160870f1a1e30af027dba9e89a6e7efdb782 /src/class.c | |
| parent | 5e8dc8cd44f501943acbd58229eb6b97894aecaf (diff) | |
| download | mruby-1f3c5125648e10ac5d9dc90be66025b4741fa24d.tar.gz mruby-1f3c5125648e10ac5d9dc90be66025b4741fa24d.zip | |
add comments for Module#instance_methods
Diffstat (limited to 'src/class.c')
| -rw-r--r-- | src/class.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/class.c b/src/class.c index 043b5e3c0..69aa31249 100644 --- a/src/class.c +++ b/src/class.c @@ -809,6 +809,34 @@ mrb_mod_included_modules(mrb_state *mrb, mrb_value self) mrb_value class_instance_method_list(mrb_state*, int, mrb_value*, struct RClass*, int); +/* 15.2.2.4.33 */ +/* + * call-seq: + * mod.instance_methods(include_super=true) -> array + * + * Returns an array containing the names of the public and protected instance + * methods in the receiver. For a module, these are the public and protected methods; + * for a class, they are the instance (not singleton) methods. With no + * argument, or with an argument that is <code>false</code>, the + * instance methods in <i>mod</i> are returned, otherwise the methods + * in <i>mod</i> and <i>mod</i>'s superclasses are returned. + * + * module A + * def method1() end + * end + * class B + * def method2() end + * end + * class C < B + * def method3() end + * end + * + * A.instance_methods #=> [:method1] + * B.instance_methods(false) #=> [:method2] + * C.instance_methods(false) #=> [:method3] + * C.instance_methods(true).length #=> 43 + */ + static mrb_value mrb_mod_instance_methods(mrb_state *mrb, mrb_value mod) { |
