Sha256: 6be2a2e5a0c20eedd1c45a0c5cafa3cd955f3f8683416a63d62f72e4f175b282

Contents?: true

Size: 360 Bytes

Versions: 8

Compression:

Stored size: 360 Bytes

Contents

#          Copyright (c) 2008 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

  # simple transformation to CamelCase from snake_case
  #
  #   'foo_bar'.camel_case # => 'FooBar'

  def camel_case
    split('_').map{|e| e.capitalize}.join
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
clivecrous-ramaze-0.3.9.5 lib/ramaze/snippets/string/camel_case.rb
manveru-ramaze-2008.07 lib/ramaze/snippets/string/camel_case.rb
manveru-ramaze-2008.08 lib/ramaze/snippets/string/camel_case.rb
ramaze-0.3.0 lib/ramaze/snippets/string/camel_case.rb
ramaze-0.3.5 lib/ramaze/snippets/string/camel_case.rb
ramaze-2008.06 lib/ramaze/snippets/string/camel_case.rb
ramaze-0.3.9 lib/ramaze/snippets/string/camel_case.rb
ramaze-0.3.9.1 lib/ramaze/snippets/string/camel_case.rb