Sha256: d75f901b53d5447ab6e949cff9b7643584876d4bac32d5895c7fad4e89524edf
Contents?: true
Size: 500 Bytes
Versions: 5
Compression:
Stored size: 500 Bytes
Contents
# Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com # All files in this distribution are subject to the terms of the MIT license. module Ramaze module CoreExtensions # Extensions for String module String # convert to snake_case from CamelCase # # @example # 'FooBar'.snake_case # => 'foo_bar' # def snake_case gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_') end end # String end # CoreExtensions end # Ramaze
Version data entries
5 entries across 5 versions & 1 rubygems