Class: String

Inherits:
Object show all
Defined in:
lib/wsdl/soap/wsdl2ruby.rb,
lib/wsdl/soap/classDefCreator.rb

Overview

uso il metodo di rails per convertire il nome della classe da camel case a snake case

Instance Method Summary collapse

Instance Method Details

#underscoreObject



25
26
27
28
29
30
31
# File 'lib/wsdl/soap/wsdl2ruby.rb', line 25

def underscore
  self.gsub(/::/, '/').
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  tr("-", "_").
  downcase
end