Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/semantic_hacker.rb
Instance Method Summary collapse
Instance Method Details
#to_underscore ⇒ Object
8 9 10 |
# File 'lib/semantic_hacker.rb', line 8 def to_underscore self.clone.to_underscore! end |
#to_underscore! ⇒ Object
5 6 7 |
# File 'lib/semantic_hacker.rb', line 5 def to_underscore! self.gsub!(/(.)([A-Z])/,'\1_\2').downcase! end |