Sha256: a8ebc6beffc6fafbedb03b28dc5eae3f5a4fe0181df4ac4e4fd0209c93bd73ab

Contents?: true

Size: 380 Bytes

Versions: 5

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true

module CreditGateway
  class CamelizerUpper
    # Converts this_is_my_string to ThisIsMyString and returns it as a symbol.
    def self.transform(underscore_string)
      underscore_string.to_s
                       .split('_')
                       .map(&:capitalize)
                       .join
                       .to_sym
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
credit_gateway-0.3.2 lib/credit_gateway/camelizer_upper.rb
credit_gateway-0.3.1 lib/credit_gateway/camelizer_upper.rb
credit_gateway-0.3.0 lib/credit_gateway/camelizer_upper.rb
credit_gateway-0.1.1 lib/credit_gateway/camelizer_upper.rb
credit_gateway-0.1.0 lib/credit_gateway/camelizer_upper.rb