Sha256: 098ba8d01cacd38636231e962f27482fcdcb46e3f5499fc2980435c9c526579f

Contents?: true

Size: 264 Bytes

Versions: 31

Compression:

Stored size: 264 Bytes

Contents

module Hubspot
  module Helpers
    class SnakeCase
      def format(string)
        string.gsub(/::/, '/').
        gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
        gsub(/([a-z\d])([A-Z])/,'\1_\2').
        tr("-", "_").
        downcase
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
hubspot-api-client-17.0.0.pre.beta.4 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-17.0.0.pre.beta.3 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-17.0.0.pre.beta.2 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-17.0.0.pre.beta.1 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.4.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.3.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.2.1 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.2.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.1.1 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.1.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.0.4 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.0.3 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.0.2 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.0.1 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-16.0.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-15.0.2 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-15.0.1 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-15.0.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.5.2 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.5.1 lib/hubspot/helpers/snake_case.rb