Class: Module
Overview
:nodoc:
Instance Method Summary collapse
- #children ⇒ Object
- #each_child ⇒ Object
- #my_methods(filter = //) ⇒ Object (also: #personal_methods)
- #self_name ⇒ Object
Instance Method Details
#children ⇒ Object
4 5 6 |
# File 'lib/rmtools/core/module.rb', line 4 def children constants.map! {|c| module_eval c}.find_all {|c| c.kinda Module rescue()} end |
#each_child ⇒ Object
8 9 10 11 |
# File 'lib/rmtools/core/module.rb', line 8 def each_child constants.map! {|c| module_eval c}.each {|c| yield c if c.kinda Module} constants end |
#my_methods(filter = //) ⇒ Object Also known as: personal_methods
17 18 19 |
# File 'lib/rmtools/core/module.rb', line 17 def my_methods filter=// self.singleton_methods.sort!.grep(filter) end |
#self_name ⇒ Object
13 14 15 |
# File 'lib/rmtools/core/module.rb', line 13 def self_name @self_name ||= name.rsplit('::', 2)[1] || name end |