Module: Tango::Kernel
- Defined in:
- lib/tango/kernel.rb
Class Method Summary collapse
-
.module_classes(mod) ⇒ Array
Fetch list of first level classes in module.
-
.symbolize(klass) ⇒ Symbol
Obtain symbol of a class.
Class Method Details
.module_classes(mod) ⇒ Array
Fetch list of first level classes in module
9 10 11 12 13 14 15 16 17 |
# File 'lib/tango/kernel.rb', line 9 def self.module_classes( mod ) mod.constants.map { |s| mod.const_get( s ) }.select { |c| Class === c } end |
.symbolize(klass) ⇒ Symbol
Obtain symbol of a class
25 26 27 |
# File 'lib/tango/kernel.rb', line 25 def self.symbolize( klass ) klass.to_s.split( '::' ).last.gsub( /(.)([A-Z])/ ,'\1_\2' ).downcase.to_sym end |