Module: Sevgi::Function::String
- Included in:
- Sevgi::Function
- Defined in:
- lib/sevgi/function/string.rb
Overview
String helpers used by generated names and user-facing text.
Instance Method Summary collapse
-
#demodulize(path) ⇒ String
Returns the final constant name segment from a module path.
Instance Method Details
#demodulize(path) ⇒ String
Returns the final constant name segment from a module path.
10 11 12 13 14 15 16 17 |
# File 'lib/sevgi/function/string.rb', line 10 def demodulize(path) path = path.to_s if (i = path.rindex("::")) path[(i + 2), path.length] else path end end |