Learning about instance variables and don't understand why the
instance variable "name" in the code example below is not visible
where as "title" is. Could someone explain this to me and why I hadto
use the "self.get_name()" method (which I don't understand since I
pulled it off the net) to get the value out of name?
Learning about instance variables and don't understand why the
instance variable "name" in the code example below is not visible
where as "title" is. Could someone explain this to me and why I hadto
use the "self.get_name()" method (which I don't understand since I
pulled it off the net) to get the value out of name?
Classes are objects in ruby and can have instance variables, so when
you set @name = "Steve" where you have put it you're create an
instance variable on the class rather than an instance variable on a
particular instance of the class.