Simple problem in looping and dynamic assignment, need suggestion.
Problem:
@var = 1
def meth
@values = (#here a query uses @var value to calculate and returns some values)
end
meth #calling meth function
# value of @value increaser when i increase @var
# i need to increment @var by 10 each time and have to call meth for @values=10
if @values.lenght < 10
# Here how can i iterate
10.times do |x|
@var += 10
meth
end
# calling meth with incremented value @var
end
I am not getting how to iterate the the method.