Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ruby-lint/extensions/string.rb
Instance Method Summary collapse
-
#snake_case ⇒ String
Creates a new string that is
snake_cased
.
Instance Method Details
#snake_case ⇒ String
Creates a new string that is snake_cased
.
11 12 13 |
# File 'lib/ruby-lint/extensions/string.rb', line 11 def snake_case return self.gsub(/([a-z])([A-Z])/, '\\1_\\2').gsub('::', '_').downcase end |