Sha256: f21d36abb2f6effa19598aed2cec3b6f0b55de8faa4faae36834ddccd1c350af

Contents?: true

Size: 480 Bytes

Versions: 9

Compression:

Stored size: 480 Bytes

Contents

module Moneta
  module CoreExt
    module String

      def self.included(base)
        base.send(:include, Extension)
      end

      module Extension
        def camelize_with_lower
          str = dup
          str = str.camelize
          str[0] = str[0].downcase

          str
        end

        def camelize
          defined?(super) ? super : dup.split('_').map(&:capitalize).join
        end
      end

    end
  end
end

String.send :include, Moneta::CoreExt::String

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
moneta-api-1.13.0 lib/moneta/core_ext/string.rb
moneta-api-1.12.8 lib/moneta/core_ext/string.rb
moneta-api-1.12.7 lib/moneta/core_ext/string.rb
moneta-api-1.12.6 lib/moneta/core_ext/string.rb
moneta-api-1.12.5 lib/moneta/core_ext/string.rb
moneta-api-1.12.4 lib/moneta/core_ext/string.rb
moneta-api-1.12.3 lib/moneta/core_ext/string.rb
moneta-api-1.12.2 lib/moneta/core_ext/string.rb
moneta-api-1.12.1 lib/moneta/core_ext/string.rb