Module: Rodzilla::Util
- Defined in:
- lib/rodzilla/util.rb
Class Method Summary collapse
-
.demodulize(path) ⇒ Object
Extracts the class name from a module string.
Class Method Details
.demodulize(path) ⇒ Object
Extracts the class name from a module string
example:
demodulize( Rodzilla::WebService::Error ) => 'Error'
returns the String path argument
10 11 12 13 14 15 16 17 |
# File 'lib/rodzilla/util.rb', line 10 def demodulize(path) path = path.to_s if i = path.rindex('::') path[(i+2)..-1] else path end end |