Skip to content

Instantly share code, notes, and snippets.

@barnes7td
Created February 20, 2014 23:50
Show Gist options
  • Select an option

  • Save barnes7td/9125880 to your computer and use it in GitHub Desktop.

Select an option

Save barnes7td/9125880 to your computer and use it in GitHub Desktop.
class Array
def sum_numbers
total = 0
self.each do |n|
p "#{total} + #{n} = #{total+n}"
total = total + n
end
total
end
end
class String
def camel_case
words_array = self.split
words_array.each do |word|
unless articles.include?|word|
word.capitalize!
end
end
words_array.first.capitalize!
words_array.join("")
end
end
class Array
def add_index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment