4 ms·
No, The first @condiments would define a class variable. class HotDog attr_accessor :condiments end Or for Java-socialized folks: class
by xtho 17y ago
No,
The first @condiments would define a class variable.
class HotDog
attr_accessor :condiments
end
Or for Java-socialized folks:
class HotDog
def initialize
@condiments = nil
end
def getCondiments
return @condiments
end
end
- jhancock 17y agooops, sorry. yes, the first line would define a "class instance" variable. btw, I didn't show the attr_accessor meta-programming sine it hides the guts of the excercise.