------ art_10138_3025138.1202177673173
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I'm sorry if this question seem stupid, but couldn't find it in the books.
I have this code in the models directory:
class Figure
attr_reader :xpos, :ypos
def initialize
@xpos
@ypos
@other
@another
end
def some
call_other(@xpos,@ypos)
end
def more
call_other(@other,@another)
end
def call_other(var1, var2)
max
var1 and(max)
var2
nd(max)
end
end
And have this on my controller:
def figure
fig igure.new
fig.some
render :text "<h1>new values</h1>"+fig.xpos.to_s+" "+fig.ypos.to_s
end
Problem is, it always print 0 0... as if the random wouldn't work, but I
have test the random outside this method (calling it in the first method,
not the second one), but the second method is one I need cos I use it too
many times and with different instance variables
Any help?
------ art_10138_3025138.1202177673173--