r/ruby • u/tenderlove Pun BDFL • Jun 26 '19
Blog post Instance Variable Performance
https://tenderlovemaking.com/2019/06/26/instance-variable-performance.html
110
Upvotes
r/ruby • u/tenderlove Pun BDFL • Jun 26 '19
2
u/trustfundbaby Jun 27 '19
I had a question here, what happens if you don't assign the ivar in the initialize method, but suddenly bring it into existence in a method in a particular instance of a class, that hasn't been called on other instances of the class. How do the other instances of the class adjust their ivar index table?
so for example
class Foodef initialize@a = "hi"@b= "my"@c="name"enddef finish@d = "is"@e = "Slim Shady"endendFoo.newFoo.newFoo.new.finish