Pardon my noobiness, but I’m learning both Ruby and Ror at the same
time and am trying to understand Ruby a bit here.
Say I have:
class Ticket
attr_accessor :venue, :date
def Test
@venue = “Some Venue”
@date = “03/31/2007”
end
end
x=Ticket.new
x.venue=“aaa”
puts x.venue
x.Test
puts x.venue
which outputs:
aaa
Some Venue
My question is:
Is the venue variable I’m referring to above, the same variable or are
they different? Is my call to x.Test (which in turn sets @venue)
essentially overwriting the same :venue instance variable? I’m just
trying to understand this a little better.
Thanks.