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