Sha256: 9265a6b96d4824fccc2bb91bfc573a7ba5618f8e0128dc41895dbc9489e65ec9

Contents?: true

Size: 254 Bytes

Versions: 6

Compression:

Stored size: 254 Bytes

Contents

module CloudstackClient
  module Utils
    def camel_case_to_underscore(camel_case)
      camel_case.gsub(/::/, '/').
        gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
        gsub(/([a-z\d])([A-Z])/,'\1_\2').
        tr("-", "_").downcase
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cloudstack_client-1.1.1 lib/cloudstack_client/utils.rb
cloudstack_client-1.1.0 lib/cloudstack_client/utils.rb
cloudstack_client-1.0.5 lib/cloudstack_client/utils.rb
cloudstack_client-1.0.4 lib/cloudstack_client/utils.rb
cloudstack_client-1.0.3 lib/cloudstack_client/utils.rb
cloudstack_client-1.0.2 lib/cloudstack_client/utils.rb