Sha256: d4d65a5efd0eaed8bf80b8c28be20344fe85ae2131c896ed9720e24d99bac462

Contents?: true

Size: 320 Bytes

Versions: 31

Compression:

Stored size: 320 Bytes

Contents

# frozen_string_literal: true

module DeepCover
  module Tools
    module Camelize
      extend self # Loaded before bootstrap
      # Poor man's camelize. 'an_example' => 'AnExample'
      def camelize(string)
        string.to_s.gsub(/([a-z\d]*)[_?!]?/) { Regexp.last_match(1).capitalize }
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
deep-cover-core-1.1.0 lib/deep_cover/tools/camelize.rb
deep-cover-core-1.0.0 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.8.1 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.8.0 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.10 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.9 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.8 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.7 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.6 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.5 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.4 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.3 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.2 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.1 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.7.0 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.6.4 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.6.3 lib/deep_cover/tools/camelize.rb
deep-cover-core-0.6.3.pre lib/deep_cover/tools/camelize.rb
deep-cover-0.6.2 lib/deep_cover/tools/camelize.rb
deep-cover-0.6.1 lib/deep_cover/tools/camelize.rb