DEV Community

Jeeho Lee
Jeeho Lee

Posted on

1 1 1 1 1

Ruby variables and pointers

Today I learned that in Ruby, almost every variable is a reference/pointer to an object. It makes sense, since when working with databases in Rails, calling .destroy actually affected the object in the database instead of destroying a copy. I think it'll be good to note going forward on whether a method returns a copy or actually alters the object being referenced.

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay