Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/resources/string.rb
Overview
rubocop:disable ClassAndModuleChildren
Instance Method Summary collapse
Instance Method Details
#to_underscore ⇒ Object
9 10 11 |
# File 'lib/resources/string.rb', line 9 def to_underscore dup.tap(&:to_underscore!) end |
#to_underscore! ⇒ Object
4 5 6 7 |
# File 'lib/resources/string.rb', line 4 def to_underscore! gsub!(/(.)([A-Z])/, '\1_\2') downcase! end |