method
instance_variable_get
![Some documentation Importance_1](https://d2vfyqvduarcvs.cloudfront.net/images/importance_1.png?1349367920)
instance_variable_get(p1)
public
Returns the value of the given instance variable, or nil if the instance variable is not set. The @ part of the variable name should be included for regular instance variables. Throws a NameError exception if the supplied symbol is not valid as an instance variable name.
class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_get(:@a) #=> "cat" fred.instance_variable_get("@b") #=> 99