Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/oos4ruby.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#underscoreObject



60
61
62
63
64
65
66
# File 'lib/oos4ruby.rb', line 60

def underscore
   self.to_s.gsub(/::/, '/').
   gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
   gsub(/([a-z\d])([A-Z])/,'\1_\2').
   tr("-", "_").
   downcase
end