Use Kernel's local_variables method : local_variables « Reflection « Ruby





Use Kernel's local_variables method


$ship = "P"
@friend_1 = "M"
@friend_2 = "J"
bad_chap = "G"

p local_variables

 

Related examples in the same category