subclasses technically do not inherit instance variables;
what does "technically do not inherit instance variables" mean?
@name = "skippy"
class PowerBoat < Boat #subclass PowerBoat inherits superclass Boat
pb = PowerBoat.new
Here clearly both the instance methods AND the value of instance variable @name is inherited. I can imagine a scenario where my misunderstanding of this could cause big problems in large projects. When I call .instance_variables on pb it returns and empty array so there seems to be a fine distinction. Maybe .name is a "pointer".
I guess a take-away for me is to avoi...
Share this highlighthttp://www.safaribooksonline.com/a/head-first-ruby/14399440/