Skip to content

Instantly share code, notes, and snippets.

@KennethanCeyer
Created March 4, 2017 20:25
Show Gist options
  • Save KennethanCeyer/7d02f92ba85c16533668bfe6cdd6e4a5 to your computer and use it in GitHub Desktop.
Save KennethanCeyer/7d02f92ba85c16533668bfe6cdd6e4a5 to your computer and use it in GitHub Desktop.
Ruby module definition
require './math'
puts Math.sum(1, 2)
module Math
def Math.sum(*args)
total = 0
args.each do |item|
total += item
end
return total
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment