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-14.5.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.4.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.3.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.2.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.1.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-14.0.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-13.2.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-13.1.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-13.0.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-12.0.0 lib/hubspot/helpers/snake_case.rb
hubspot-api-client-11.2.0 lib/hubspot/helpers/snake_case.rb