class String
Public Instance Methods
underscore_case()
click to toggle source
Converts “CamelCase”“ into ”camel_case“
# 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