Answers for "ruby get instance variables without accessor"

0

Ruby instance variabnl get

some_object.instance_variable_get("@#{name}")
Posted by: Guest on September-02-2020
0

ruby get instance variables without accessor

foo.instance_variable_set(:@foo, 12) 
puts foo.instance_variable_get(:@foo)
Posted by: Guest on December-12-2020

Browse Popular Code Answers by Language