Re:How to Dynamically Create Instance Variables in Ruby
by rubyn00bie on Friday July 28, 2023 @08:14AM
(#36905737)
Your example is not equivalent to the Ruby code. You’re just assigning a value to a property which is always exposed, you’re showing getters/setters. The instance variables are not by default exposed or accessible outside the class/object.
[ Parent
| on HN ]
Re:How to Dynamically Create Instance Variables in Ruby
by danielheath on Friday July 28, 2023 @09:36AM
(#36906566)
On the other hand...
foo = {bar: "123"}; with (foo) eval("console.log(bar)")