Sha256: 7150f49c9fe7f15f0b4fec18da767e33014a6a6a8dbcd2e6255b9a69819ae5ab
Contents?: true
Size: 518 Bytes
Versions: 31
Compression:
Stored size: 518 Bytes
Contents
module ActiveSupportMethods def camelize sub(/^([a-z])/) {$1.upcase}.gsub(/_([a-z])/) do $1.upcase end end # Source # http://github.com/rails/rails/blob/b600bf2cd728c90d50cc34456c944b2dfefe8c8d/activesupport/lib/active_support/inflector.rb def underscore gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end end String.send :include, ActiveSupportMethods unless String.new.respond_to?(:underscore)
Version data entries
31 entries across 31 versions & 4 rubygems