Public Instance methods
underscore()
[show source]
# File lib/httpx/plugins/grpc.rb 25 def underscore 26 s = dup # Avoid mutating the argument, as it might be frozen. 27 s.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2') 28 s.gsub!(/([a-z\d])([A-Z])/, '\1_\2') 29 s.tr!("-", "_") 30 s.downcase! 31 s 32 end