Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/biosphere/kube.rb
Instance Method Summary collapse
-
#underscore_case ⇒ Object
Converts “CamelCase”“ into ”camel_case“.
Instance Method Details
#underscore_case ⇒ Object
Converts “CamelCase”“ into ”camel_case“
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/biosphere/kube.rb', line 11 def underscore_case() str = "" self.chars.each do |c| if c == c.upcase if str != "" str += "_" end str += c.downcase else str += c end end return str end |