Last active
August 29, 2015 14:14
-
-
Save Kameshwaran/61a547f9751e7bd12954 to your computer and use it in GitHub Desktop.
Camelize in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple camelize in ruby | |
class String | |
def camelize | |
split("_").map(&:capitalize).join | |
end | |
end | |
# "kamesh_test" => "KameshTest" | |
# "code_brahma" => "Codebrahma" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment