Sha256: 224d1439888b134837e6df7e8d6c42dc7e29cc70298c17a0fd7a1c3aa84db893

Contents?: true

Size: 317 Bytes

Versions: 4

Compression:

Stored size: 317 Bytes

Contents

# frozen_string_literal: true
module FreshdeskApiclient
  module Utils
    module Camelizable
      def camelize(term)
        string = term.to_s
        string = string.sub(/^[a-z\d]*/) { $&.capitalize }
        string.gsub!(%r{(?:_|(/))([a-z\d]*)}) { $2.capitalize.to_s }
        string
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
freshdesk_apiclient-0.1.3 lib/freshdesk_apiclient/utils/camelizable.rb
freshdesk_apiclient-0.1.2 lib/freshdesk_apiclient/utils/camelizable.rb
freshdesk_apiclient-0.1.1 lib/freshdesk_apiclient/utils/camelizable.rb
freshdesk_apiclient-0.1.0 lib/freshdesk_apiclient/utils/camelizable.rb