Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2015 07:26
Show Gist options
  • Save anonymous/165490d915772b902f64 to your computer and use it in GitHub Desktop.
Save anonymous/165490d915772b902f64 to your computer and use it in GitHub Desktop.
module MathTalk
def array_add(arr)
result = 0
arr.each { |x| result += x }
rescue
unless arr.is_a?
result = "Enter an array stupid!"
end
return result
end
# def array_op_cycler(arr, cycle_in = 1)
# end
end
MathTalk.array_add("bla")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment