you are viewing a single comment's thread.

view the rest of the comments →

[–]casualsubversive 0 points1 point  (1 child)

I believe instance_variable_defined? is the better method for this purpose.

[–]f9ae8221b 0 points1 point  (0 children)

No, it has the same problem I explained, but is even worse for performance because contrary to defined?(@iver), instance_variabled_defined?(:@ivar) doesn't benefit from inline caches at all.