From example:
local_var = "Thanks!"
@instance_var = "Thank you ,too"
Then how can I get the local_var and instance_var part by them self.
I mean weather there is a method maybe called get_self_name to get the name of himself:
local_var.get_self_name # => 'local_var'
@instance_var.get_self_name # => '@instance_var' or => 'instance_var'
a = 'abc'
a.get_self_name # => 'a'
You also may want to check out
ObjectSpacemodule.The
_local variable is automatically set to returned value of the last irb statement. @prompt is probably irb’s prompt format or something similar.