hi, i’m the beginner in ruby. My task is change this version of code to
nonarguments method of Fixnum class using yield. That’ll be passed if i
could typing for example 12.divisions{|x| puts x} and it will be works.
I try it a lot but that’s my first time in ruby… and this is my
version for method with argue
def divisions(n)
i=1
while i <= n
if n%i>0
i += 1
else
yield n/i
i += 1
end
end
end