|
| 1 | +module RBS |
| 2 | + module Unnamed |
| 3 | + class TopLevelSelfClass |
| 4 | + # <!-- |
| 5 | + # rdoc-file=eval.c |
| 6 | + # - include(module, ...) -> self |
| 7 | + # --> |
| 8 | + # Invokes Module.append_features on each parameter in reverse order. |
| 9 | + # |
| 10 | + %a{annotate:rdoc:copy:Module#include} |
| 11 | + def include: (Module, *Module arg0) -> self |
| 12 | + |
| 13 | + # <!-- |
| 14 | + # rdoc-file=eval.c |
| 15 | + # - using(module) -> self |
| 16 | + # --> |
| 17 | + # Import class refinements from *module* into the current class or module |
| 18 | + # definition. |
| 19 | + # |
| 20 | + %a{annotate:rdoc:copy:Module#using} |
| 21 | + def using: (Module arg0) -> self |
| 22 | + |
| 23 | + # <!-- |
| 24 | + # rdoc-file=proc.c |
| 25 | + # - define_method(symbol, method) -> symbol |
| 26 | + # - define_method(symbol) { block } -> symbol |
| 27 | + # --> |
| 28 | + # Defines an instance method in the receiver. The *method* parameter can be a |
| 29 | + # `Proc`, a `Method` or an `UnboundMethod` object. If a block is specified, it |
| 30 | + # is used as the method body. If a block or the *method* parameter has |
| 31 | + # parameters, they're used as method parameters. This block is evaluated using |
| 32 | + # #instance_eval. |
| 33 | + # |
| 34 | + # class A |
| 35 | + # def fred |
| 36 | + # puts "In Fred" |
| 37 | + # end |
| 38 | + # def create_method(name, &block) |
| 39 | + # self.class.define_method(name, &block) |
| 40 | + # end |
| 41 | + # define_method(:wilma) { puts "Charge it!" } |
| 42 | + # define_method(:flint) {|name| puts "I'm #{name}!"} |
| 43 | + # end |
| 44 | + # class B < A |
| 45 | + # define_method(:barney, instance_method(:fred)) |
| 46 | + # end |
| 47 | + # a = B.new |
| 48 | + # a.barney |
| 49 | + # a.wilma |
| 50 | + # a.flint('Dino') |
| 51 | + # a.create_method(:betty) { p self } |
| 52 | + # a.betty |
| 53 | + # |
| 54 | + # *produces:* |
| 55 | + # |
| 56 | + # In Fred |
| 57 | + # Charge it! |
| 58 | + # I'm Dino! |
| 59 | + # #<B:0x401b39e8> |
| 60 | + # |
| 61 | + %a{annotate:rdoc:copy:Module#define_method} |
| 62 | + def define_method: (interned symbol, ^(?) [self: top] -> untyped | Method | UnboundMethod method) -> Symbol |
| 63 | + | (interned symbol) { (?) [self: top] -> untyped } -> Symbol |
| 64 | + |
| 65 | + # <!-- |
| 66 | + # rdoc-file=vm_method.c |
| 67 | + # - public -> nil |
| 68 | + # - public(method_name) -> method_name |
| 69 | + # - public(method_name, method_name, ...) -> array |
| 70 | + # - public(array) -> array |
| 71 | + # --> |
| 72 | + # With no arguments, sets the default visibility for subsequently defined |
| 73 | + # methods to public. With arguments, sets the named methods to have public |
| 74 | + # visibility. String arguments are converted to symbols. An Array of Symbols |
| 75 | + # and/or Strings is also accepted. If a single argument is passed, it is |
| 76 | + # returned. If no argument is passed, nil is returned. If multiple arguments are |
| 77 | + # passed, the arguments are returned as an array. |
| 78 | + # |
| 79 | + %a{annotate:rdoc:copy:Module#public} |
| 80 | + def public: () -> nil |
| 81 | + | (Symbol method_name) -> Symbol |
| 82 | + | (Symbol, Symbol, *Symbol method_name) -> Array[Symbol] |
| 83 | + | (string method_name) -> string |
| 84 | + | (interned, interned, *interned method_name) -> Array[interned] |
| 85 | + | (Array[interned]) -> Array[interned] |
| 86 | + |
| 87 | + # <!-- |
| 88 | + # rdoc-file=vm_method.c |
| 89 | + # - private -> nil |
| 90 | + # - private(method_name) -> method_name |
| 91 | + # - private(method_name, method_name, ...) -> array |
| 92 | + # - private(array) -> array |
| 93 | + # --> |
| 94 | + # With no arguments, sets the default visibility for subsequently defined |
| 95 | + # methods to private. With arguments, sets the named methods to have private |
| 96 | + # visibility. String arguments are converted to symbols. An Array of Symbols |
| 97 | + # and/or Strings is also accepted. If a single argument is passed, it is |
| 98 | + # returned. If no argument is passed, nil is returned. If multiple arguments are |
| 99 | + # passed, the arguments are returned as an array. |
| 100 | + # |
| 101 | + # module Mod |
| 102 | + # def a() end |
| 103 | + # def b() end |
| 104 | + # private |
| 105 | + # def c() end |
| 106 | + # private :a |
| 107 | + # end |
| 108 | + # Mod.private_instance_methods #=> [:a, :c] |
| 109 | + # |
| 110 | + # Note that to show a private method on RDoc, use `:doc:`. |
| 111 | + # |
| 112 | + %a{annotate:rdoc:copy:Module#private} |
| 113 | + def private: () -> nil |
| 114 | + | (Symbol method_name) -> Symbol |
| 115 | + | (Symbol, Symbol, *Symbol method_name) -> Array[Symbol] |
| 116 | + | (string method_name) -> string |
| 117 | + | (interned, interned, *interned method_name) -> Array[interned] |
| 118 | + | (Array[interned]) -> Array[interned] |
| 119 | + end |
| 120 | + end |
| 121 | +end |
0 commit comments