Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created November 7, 2014 01:34
Show Gist options
  • Save angelsystem/53aec5f3715f5bffb142 to your computer and use it in GitHub Desktop.
Save angelsystem/53aec5f3715f5bffb142 to your computer and use it in GitHub Desktop.
demo suma
class SumarDigitos
def sumar_numbers(number)
sum = 0
number.to_s.each_char do |n|
sum = sum + (n.to_i)
end
sum
end
end
sumar = SumarDigitos.new
puts sumar.sumar_numbers(98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment