module CloudstackClient::Utils

Public Instance Methods

camel_case_to_underscore(camel_case) click to toggle source
  # File lib/cloudstack_client/utils.rb
4 def camel_case_to_underscore(camel_case)
5   camel_case.gsub(/::/, '/').
6     gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
7     gsub(/([a-z\d])([A-Z])/,'\1_\2').
8     tr("-", "_").downcase
9 end
print_debug_output(output, separator = '-' * 80) click to toggle source
underscore_to_camel_case(underscore) click to toggle source
   # File lib/cloudstack_client/utils.rb
11 def underscore_to_camel_case(underscore)
12   if underscore.include? "_"
13     string = underscore.split('_').collect(&:capitalize).join
14     string[0].downcase + string[1..-1]
15   else
16     underscore
17   end
18 end