Sha256: 4e668676d0542e1023b0f8c47f091cac0693f95dbe5fbde4ad671620f5bd4783

Contents?: true

Size: 479 Bytes

Versions: 14

Compression:

Stored size: 479 Bytes

Contents

module Moneta
  module CoreExt
    module String

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

      module Extension
        def classify_with_lower
          str = dup
          str = str.classify
          str[0] = str[0].downcase

          str
        end

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

    end
  end
end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
moneta-api-1.12.0 lib/moneta/core_ext/string.rb
moneta-api-1.11.0 lib/moneta/core_ext/string.rb
moneta-api-1.10.0 lib/moneta/core_ext/string.rb
moneta-api-1.9.0 lib/moneta/core_ext/string.rb
moneta-api-1.8.0 lib/moneta/core_ext/string.rb
moneta-api-1.7.0 lib/moneta/core_ext/string.rb
moneta-api-1.6.0 lib/moneta/core_ext/string.rb
moneta-api-1.5.0 lib/moneta/core_ext/string.rb
moneta-api-1.4.0 lib/moneta/core_ext/string.rb
moneta-api-1.3.0 lib/moneta/core_ext/string.rb
moneta-api-1.2.1 lib/moneta/core_ext/string.rb
moneta-api-1.2.0 lib/moneta/core_ext/string.rb
moneta-api-1.1.0 lib/moneta/core_ext/string.rb
moneta-api-1.0.4 lib/moneta/core_ext/string.rb